From: Junio C Hamano Date: Sun, 20 Apr 2008 06:01:51 +0000 (-0700) Subject: Merge branch 'jc/maint-rebase-am' into maint X-Git-Tag: v1.5.5.1~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41a3e3aa9bdaede9ab7afed206428c1b071060d2;p=git.git Merge branch 'jc/maint-rebase-am' into maint * jc/maint-rebase-am: rebase: do not munge commit log message Conflicts: git-am.sh --- 41a3e3aa9bdaede9ab7afed206428c1b071060d2 diff --cc git-am.sh index a391254a7,5a7695efa..75886a8f2 --- a/git-am.sh +++ b/git-am.sh @@@ -327,11 -327,20 +327,20 @@@ d echo "Patch is empty. Was it split wrong?" stop_here $this } - SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" - case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac - - (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | - git stripspace > "$dotest/msg-clean" + if test -f "$dotest/rebasing" && + commit=$(sed -e 's/^From \([0-9a-f]*\) .*/\1/' \ + -e q "$dotest/$msgnum") && + test "$(git cat-file -t "$commit")" = commit + then + git cat-file commit "$commit" | + sed -e '1,/^$/d' >"$dotest/msg-clean" + else + SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" + case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac + - (echo "$SUBJECT" ; echo ; cat "$dotest/msg") | ++ (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | + git stripspace > "$dotest/msg-clean" + fi ;; esac