Code

http-push: push <remote> :<branch> deletes remote branch
[git.git] / merge-recursive.c
index dd52342539cd05e59bb13e956d51251417f21e3c..55ef76f5a5f855475f796dfda39fa3417179be8b 100644 (file)
@@ -1673,6 +1673,8 @@ static struct commit *get_ref(const char *ref)
        if (get_sha1(ref, sha1))
                die("Could not resolve ref '%s'", ref);
        object = deref_tag(parse_object(sha1), ref, strlen(ref));
+       if (!object)
+               return NULL;
        if (object->type == OBJ_TREE)
                return make_virtual_commit((struct tree*)object,
                        better_branch_name(ref));