aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-08 00:41:37 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-08 01:23:53 -0800
commit4bfb6b62ffc9460798ebc78c3a30e4eff7c409d0 (patch)
tree75922cf23cc070e2d5220d961a8f645f1bc8bb60 /git-am.sh
parent39b4ac99686148d356f7ba3c0132eb55dfda4726 (diff)
downloadgit-4bfb6b62ffc9460798ebc78c3a30e4eff7c409d0.tar.gz
git-4bfb6b62ffc9460798ebc78c3a30e4eff7c409d0.tar.xz
git-am: do not lose already edited final-commit when resuming.
The last round stopped munging the patch when resuming, but failed to preserve final-commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh31
1 files changed, 19 insertions, 12 deletions
diff --git a/git-am.sh b/git-am.sh
index 115ebaddf..38841d9be 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -224,29 +224,33 @@ do
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
;;
esac
- resume=
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
- SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
- if test '' != "$SIGNOFF"
- then
+
+ case "$resume" in
+ '')
+ if test '' != "$SIGNOFF"
+ then
LAST_SIGNED_OFF_BY=`
- sed -ne '/^Signed-off-by: /p' "$dotest/msg-clean" |
- tail -n 1
+ sed -ne '/^Signed-off-by: /p' \
+ "$dotest/msg-clean" |
+ tail -n 1
`
- ADD_SIGNOFF=$(test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
+ ADD_SIGNOFF=`
+ test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
test '' = "$LAST_SIGNED_OFF_BY" && echo
echo "$SIGNOFF"
- })
- else
+ }`
+ else
ADD_SIGNOFF=
- fi
- {
+ fi
+ {
echo "$SUBJECT"
if test -s "$dotest/msg-clean"
then
@@ -257,8 +261,11 @@ do
then
echo "$ADD_SIGNOFF"
fi
- } >"$dotest/final-commit"
+ } >"$dotest/final-commit"
+ ;;
+ esac
+ resume=
if test "$interactive" = t
then
test -t 0 ||