diff options
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | 2012-06-26 07:51:56 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-06-26 13:17:56 -0700 |
commit | a230949409f4a650c6a1a9a5879e2a8b993ba695 (patch) | |
tree | b367408f8d3f6aa62807b6303552e633704b27c5 /git-am.sh | |
parent | f2b6a19907ccb366790c7ec7b640f9111ac7ad32 (diff) | |
download | git-a230949409f4a650c6a1a9a5879e2a8b993ba695.tar.gz |
am --rebasing: get patch body from commit, not from mailbox
Rebasing a commit that contains a diff in the commit message results
in a failure with output such as
First, rewinding head to replay your work on top of it...
Applying: My cool patch.
fatal: sha1 information is lacking or useless
(app/controllers/settings_controller.rb).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 My cool patch.
The reason is that 'git rebase' without -p/-i/-m internally calls 'git
format-patch' and pipes the output to 'git am --rebasing', which has
no way of knowing what is a real patch and what is a commit message
that contains a patch.
Make 'git am' while in --rebasing mode get the patch body from the
commit object instead of extracting it from the mailbox.
Patch by Junio, test case and commit log message by Martin.
Reported-by: anikey <arty.anikey@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-x | git-am.sh | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -683,6 +683,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"." sed -e '1,/^$/d' >"$dotest/msg-clean" echo "$commit" > "$dotest/original-commit" get_author_ident_from_commit "$commit" > "$dotest/author-script" + git diff-tree --root --binary "$commit" >"$dotest/patch" else { sed -n '/^Subject/ s/Subject: //p' "$dotest/info" |