builtin/grep.c: respect 'submodule.recurse' option
[gitweb.git] / builtin / am.c
index a63935cc83409ef99551a69da79d52ac297fe83a..8e9ac1144d205252551e4b22605d8d8da55297b3 100644 (file)
@@ -2150,7 +2150,7 @@ static void am_abort(struct am_state *state)
        am_rerere_clear();
 
        curr_branch = resolve_refdup("HEAD", 0, curr_head.hash, NULL);
-       has_curr_head = !is_null_oid(&curr_head);
+       has_curr_head = curr_branch && !is_null_oid(&curr_head);
        if (!has_curr_head)
                hashcpy(curr_head.hash, EMPTY_TREE_SHA1_BIN);