X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-am.sh;h=2ecebc45a93784f1ca377941cd9b96569b3ade1c;hb=8e0f70033b2bd1679a6e5971978fdc3ee09bdb72;hp=76c1c844a95d8af19f64a3278706daf907dace01;hpb=b52e985a4f824128d01220473b04057a4876060d;p=git.git diff --git a/git-am.sh b/git-am.sh index 76c1c844a..2ecebc45a 100755 --- a/git-am.sh +++ b/git-am.sh @@ -14,7 +14,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 @@ -117,6 +117,10 @@ It does not apply to blobs recorded in its index." unset GITHEAD_$his_tree } +reread_subject () { + git stripspace <"$1" | sed -e 1q +} + prec=4 dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= resolvemsg= resume= @@ -376,6 +380,7 @@ do [aA]*) action=yes interactive= ;; [nN]*) action=skip ;; [eE]*) git_editor "$dotest/final-commit" + SUBJECT=$(reread_subject "$dotest/final-commit") action=again ;; [vV]*) action=again LESS=-S ${PAGER:-less} "$dotest/patch" ;; @@ -464,9 +469,9 @@ do "$GIT_DIR"/hooks/post-applypatch fi - git gc --auto - go_next done +git gc --auto + rm -fr "$dotest"