Accept tags in HEAD or MERGE_HEAD
[gitweb.git] / builtin / merge.c
index f5eb3f549b3732c894016a83e3108df3b3f46d81..9567d60ba2d46e5f30cb6d954a74db8bcb5e9ee5 100644 (file)
@@ -1036,11 +1036,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
                branch += 11;
        if (!branch || is_null_sha1(head_sha1))
                head_commit = NULL;
-       else {
-               head_commit = lookup_commit(head_sha1);
-               if (!head_commit)
-                       die(_("could not parse HEAD"));
-       }
+       else
+               head_commit = lookup_commit_or_die(head_sha1, "HEAD");
 
        git_config(git_merge_config, NULL);