summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae8e4c9)
raw | patch | inline | side by side (parent: ae8e4c9)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 7 Nov 2011 22:45:10 +0000 (14:45 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 8 Nov 2011 18:36:53 +0000 (10:36 -0800) |
Otherwise, "git commit" wouldn't have a way to tell that we were in the
middle of merging an annotated or signed tag, not a plain commit, after
"git merge" stops to ask the user to resolve conflicts.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
middle of merging an annotated or signed tag, not a plain commit, after
"git merge" stops to ask the user to resolve conflicts.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c | patch | blob | history | |
t/t7600-merge.sh | patch | blob | history |
diff --git a/builtin/merge.c b/builtin/merge.c
index 8d4eb4e423a2513e7b537416ab397a543b17e6b3..7158e8e2d2e24145ffa77233a2e1071fa445a025 100644 (file)
--- a/builtin/merge.c
+++ b/builtin/merge.c
struct commit_list *j;
struct strbuf buf = STRBUF_INIT;
- for (j = remoteheads; j; j = j->next)
- strbuf_addf(&buf, "%s\n",
- sha1_to_hex(j->item->object.sha1));
+ for (j = remoteheads; j; j = j->next) {
+ unsigned const char *sha1;
+ struct commit *c = j->item;
+ if (c->util && merge_remote_util(c)->obj) {
+ sha1 = merge_remote_util(c)->obj->sha1;
+ } else {
+ sha1 = c->object.sha1;
+ }
+ strbuf_addf(&buf, "%s\n", sha1_to_hex(sha1));
+ }
fd = open(git_path("MERGE_HEAD"), O_WRONLY | O_CREAT, 0666);
if (fd < 0)
die_errno(_("Could not open '%s' for writing"),
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index b91d022bc6f1886ead6780387da5a871c2e359ec..5d8c428543bd61a27489af72045b4e1816d240e9 100755 (executable)
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
verify_mergeheads () {
printf '%s\n' "$@" >mergehead.expected &&
- test_cmp mergehead.expected .git/MERGE_HEAD
+ while read sha1 rest
+ do
+ git rev-parse $sha1
+ done <.git/MERGE_HEAD >mergehead.actual &&
+ test_cmp mergehead.expected mergehead.actual
}
verify_no_mergehead () {