aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-11-07 14:45:10 -0800
committerJunio C Hamano <gitster@pobox.com>2011-11-08 10:36:53 -0800
commit274a5c06d525da8c9720ae60454fba6779523c52 (patch)
treea7ad758e0777c7e7fa6486243b8b6edc2de129e1 /builtin
parentae8e4c9ce10ea9439a88b79a40aeff4696d40416 (diff)
downloadgit-274a5c06d525da8c9720ae60454fba6779523c52.tar.gz
git-274a5c06d525da8c9720ae60454fba6779523c52.tar.xz
merge: record tag objects without peeling in MERGE_HEAD
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 8d4eb4e42..7158e8e2d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1045,9 +1045,16 @@ static void write_merge_state(void)
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"),