Skip to content

Commit f23272f

Browse files
committed
git-am -i: report rewritten title
Jeff Garzik noticed that "git am -i" reports the applied patch with the title before the user edited it. This was confusing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6326cee commit f23272f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-am.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ It does not apply to blobs recorded in its index."
102102
unset GITHEAD_$his_tree
103103
}
104104

105+
reread_subject () {
106+
git stripspace <"$1" | sed -e 1q
107+
}
108+
105109
prec=4
106110
dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary=
107111
resolvemsg= resume=
@@ -372,6 +376,7 @@ do
372376
[aA]*) action=yes interactive= ;;
373377
[nN]*) action=skip ;;
374378
[eE]*) git_editor "$dotest/final-commit"
379+
SUBJECT=$(reread_subject "$dotest/final-commit")
375380
action=again ;;
376381
[vV]*) action=again
377382
LESS=-S ${PAGER:-less} "$dotest/patch" ;;

0 commit comments

Comments
 (0)