Skip to content

Commit

Permalink
git-am -i: report rewritten title
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 6, 2007
1 parent 6326cee commit f23272f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,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=
Expand Down Expand Up @@ -372,6 +376,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" ;;
Expand Down

0 comments on commit f23272f

Please sign in to comment.