]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
"remote prune": be quiet when there is nothing to prune
[git.git] / git-am.sh
index 5a7695efae14fa3a0551bbed86a6184716dd7045..b48096ec2037e3f14d4bdf89a0afe4623aff090e 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -11,7 +11,7 @@ git-am [options] --skip
 --
 d,dotest=       (removed -- do not use)
 i,interactive   run interactively
-b,binary        pass --allo-binary-replacement to git-apply
+b,binary        pass --allow-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)
@@ -338,7 +338,7 @@ do
                        SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
                        case "$keep_subject" in -k)  SUBJECT="[PATCH] $SUBJECT" ;; esac
 
-                       (echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
+                       (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") |
                                git stripspace > "$dotest/msg-clean"
                fi
                ;;
@@ -392,7 +392,6 @@ do
                        ;;
                esac
        esac
-       FIRSTLINE=$(head -1 "$dotest/final-commit")
 
        resume=
        if test "$interactive" = t
@@ -413,7 +412,6 @@ do
                [aA]*) action=yes interactive= ;;
                [nN]*) action=skip ;;
                [eE]*) git_editor "$dotest/final-commit"
-                      FIRSTLINE=$(head -1 "$dotest/final-commit")
                       action=again ;;
                [vV]*) action=again
                       LESS=-S ${PAGER:-less} "$dotest/patch" ;;
@@ -423,6 +421,7 @@ do
        else
            action=yes
        fi
+       FIRSTLINE=$(head -1 "$dotest/final-commit")
 
        if test $action = skip
        then