read_early_config(): really discover .git/
[gitweb.git] / builtin / reset.c
index c04ac076dc53b99039768dcdcbf2861e285896c2..8ab915bfcb71ae5d5f4bd1bebe7fd3c8725780b2 100644 (file)
@@ -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))