From: Junio C Hamano Date: Sat, 19 Apr 2008 07:25:15 +0000 (-0700) Subject: Merge branch 'jc/maint-rebase-am' X-Git-Tag: v1.5.6-rc0~141 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8876046037a3064f906d2155ea30cb6db186e409;p=git.git Merge branch 'jc/maint-rebase-am' * jc/maint-rebase-am: rebase: do not munge commit log message Conflicts: git-am.sh --- 8876046037a3064f906d2155ea30cb6db186e409 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