commit: make it work with status.short
[gitweb.git] / builtin / reset.c
index 45b01ebbcc81cb0acde12b97eea1ae9afd341559..6032131a9087281e97d0abc05365b7485004121b 100644 (file)
@@ -23,8 +23,8 @@
 
 static const char * const git_reset_usage[] = {
        N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
-       N_("git reset [-q] <commit> [--] <paths>..."),
-       N_("git reset --patch [<commit>] [--] [<paths>...]"),
+       N_("git reset [-q] <tree-ish> [--] <paths>..."),
+       N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
        NULL
 };
 
@@ -322,7 +322,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
        if (reset_type != SOFT) {
                struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
                int newfd = hold_locked_index(lock, 1);
-               if (pathspec) {
+               if (reset_type == MIXED) {
                        if (read_from_tree(pathspec, sha1))
                                return 1;
                } else {