Merge branch 'jc/push-default-explicit'
[gitweb.git] / builtin / reset.c
index 5aa86079d3af8e37a084653845b1fed8d3db6b83..8ab915bfcb71ae5d5f4bd1bebe7fd3c8725780b2 100644 (file)
@@ -24,7 +24,7 @@
 
 static const char * const git_reset_usage[] = {
        N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
-       N_("git reset [-q] <tree-ish> [--] <paths>..."),
+       N_("git reset [-q] [<tree-ish>] [--] <paths>..."),
        N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
        NULL
 };
@@ -354,7 +354,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 
        if (reset_type != SOFT) {
                struct lock_file *lock = xcalloc(1, sizeof(*lock));
-               hold_locked_index(lock, 1);
+               hold_locked_index(lock, LOCK_DIE_ON_ERROR);
                if (reset_type == MIXED) {
                        int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
                        if (read_from_tree(&pathspec, &oid, intent_to_add))