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>
Junio C Hamano committed
Nov 8, 2005 at 00:41 UTC
4bfb6b62ffc9460798ebc78c3a30e4eff7c409d0
1 file changed
+19
-12
git-am.sh
+19
-12
@@ -224,29 +224,33 @@ do
224
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
225
;;
226
esac
227
- resume=
227
228
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
229
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
230
GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
232
- SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
231
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
232
233
+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
234
case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
236
- if test '' != "$SIGNOFF"
237
- then
235
+
236
+ case "$resume" in
237
+ '')
238
+ if test '' != "$SIGNOFF"
239
+ then
240
LAST_SIGNED_OFF_BY=`
239
- sed -ne '/^Signed-off-by: /p' "$dotest/msg-clean" |
240
- tail -n 1
241
+ sed -ne '/^Signed-off-by: /p' \
242
+ "$dotest/msg-clean" |
243
+ tail -n 1
244
`
242
- ADD_SIGNOFF=$(test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
245
+ ADD_SIGNOFF=`
246
+ test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
247
test '' = "$LAST_SIGNED_OFF_BY" && echo
248
echo "$SIGNOFF"
245
- })
246
- else
249
+ }`
250
+ else
251
ADD_SIGNOFF=
248
- fi
249
- {
252
+ fi
253
+ {
254
echo "$SUBJECT"
255
if test -s "$dotest/msg-clean"
256
then
@@ -257,8 +261,11 @@ do
261
then
262
echo "$ADD_SIGNOFF"
263
fi
260
- } >"$dotest/final-commit"
264
+ } >"$dotest/final-commit"
265
+ ;;
266
+ esac
267
268
+ resume=
269
if test "$interactive" = t
270
then
271
test -t 0 ||