summaryrefslogtreecommitdiffstats
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-14 04:03:19 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-14 04:03:19 +0200
commit0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496 (patch)
treee8ff37c5dce1e0eb7e33da89d487fcb21bbec6c0 /revision.c
parentMerge branch 'bw/grep-no-index-no-exclude' (diff)
parentAccept tags in HEAD or MERGE_HEAD (diff)
downloadgit-0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496.tar.xz
git-0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496.zip
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 9bae329c15..66a882029f 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);