Merge branch 'ks/verify-filename-non-option-error-message-tweak'
[gitweb.git] / builtin / commit.c
index 0f8ddb6866b3d14c4e6b84f019110387c7f77319..d75b3805ea7fe3475564f337bf660d8155909445 100644 (file)
@@ -1392,7 +1392,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        read_cache_preload(&s.pathspec);
        refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
 
-       fd = hold_locked_index(&index_lock, 0);
+       if (use_optional_locks())
+               fd = hold_locked_index(&index_lock, 0);
+       else
+               fd = -1;
 
        s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
        if (!s.is_initial)