t0302 & t3900: add forgotten quotes
[gitweb.git] / builtin / am.c
index 4b89289d1e7dae8073279cc115dafc6b2cf183a4..593c1b5dda953d146c66a479b3bc5028efad5bf8 100644 (file)
@@ -2148,7 +2148,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);
 
@@ -2311,6 +2311,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
+       if (argc == 2 && !strcmp(argv[1], "-h"))
+               usage_with_options(usage, options);
+
        git_config(git_am_config, NULL);
 
        am_state_init(&state);