Code

describe: fix --long output
[git.git] / git-am.sh
index 65c634f77af98b3598bfb50583de05f0cf5d6eb4..a2c6fea47af1e4616bc549f26f3fe1b364841abe 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -2,6 +2,7 @@
 #
 # Copyright (c) 2005, 2006 Junio C Hamano
 
+SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
 git-am [options] <mbox>|<Maildir>...
@@ -14,7 +15,7 @@ b,binary        pass --allo-binary-replacement to git-apply
 3,3way          allow fall back on 3way merging if needed
 s,signoff       add a Signed-off-by line to the commit message
 u,utf8          recode into utf8 (default)
-k,keep          pass -k flagg to git-mailinfo
+k,keep          pass -k flag to git-mailinfo
 whitespace=     pass it through git-apply
 C=              pass it through git-apply
 p=              pass it through git-apply
@@ -25,6 +26,7 @@ skip            skip the current patch"
 . git-sh-setup
 set_reflog_action am
 require_work_tree
+cd_to_toplevel
 
 git var GIT_COMMITTER_IDENT >/dev/null || exit
 
@@ -469,9 +471,9 @@ do
                "$GIT_DIR"/hooks/post-applypatch
        fi
 
-       git gc --auto
-
        go_next
 done
 
+git gc --auto
+
 rm -fr "$dotest"