diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-14 04:03:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-14 04:03:19 +0200 |
commit | 0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496 (patch) | |
tree | e8ff37c5dce1e0eb7e33da89d487fcb21bbec6c0 /revision.c | |
parent | Merge branch 'bw/grep-no-index-no-exclude' (diff) | |
parent | Accept tags in HEAD or MERGE_HEAD (diff) | |
download | git-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.c | 6 |
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); |