aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-13 19:03:19 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-13 19:03:19 -0700
commit0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496 (patch)
treee8ff37c5dce1e0eb7e33da89d487fcb21bbec6c0 /revision.c
parent6fdab32e14e2bca05ae6471502bcdfd35b381564 (diff)
parentbaf18fc261ca475343fe3cb9cd2c0dded4bc1bb7 (diff)
downloadgit-0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496.tar.gz
git-0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496.tar.xz
Merge branch 'nd/maint-autofix-tag-in-head'
* nd/maint-autofix-tag-in-head: Accept tags in HEAD or MERGE_HEAD merge: remove global variable head[] merge: use return value of resolve_ref() to determine if HEAD is invalid merge: keep stash[] a local variable Conflicts: builtin/merge.c
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/revision.c b/revision.c
index 9bae329c1..66a882029 100644
--- a/revision.c
+++ b/revision.c
@@ -1052,10 +1052,12 @@ static void prepare_show_merge(struct rev_info *revs)
const char **prune = NULL;
int i, prune_num = 1; /* counting terminating NULL */
- if (get_sha1("HEAD", sha1) || !(head = lookup_commit(sha1)))
+ if (get_sha1("HEAD", sha1))
die("--merge without HEAD?");
- if (get_sha1("MERGE_HEAD", sha1) || !(other = lookup_commit(sha1)))
+ head = lookup_commit_or_die(sha1, "HEAD");
+ if (get_sha1("MERGE_HEAD", sha1))
die("--merge without MERGE_HEAD?");
+ other = lookup_commit_or_die(sha1, "MERGE_HEAD");
add_pending_object(revs, &head->object, "HEAD");
add_pending_object(revs, &other->object, "MERGE_HEAD");
bases = get_merge_bases(head, other, 1);