Merge branch 'rs/absolute-pathdup'
[gitweb.git] / builtin / add.c
index e8fb80b36e7386fa9a9da91a61893c14ec696be4..9f53f020d0fc7184ac803a4346bdf426a814ed72 100644 (file)
@@ -361,7 +361,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        add_new_files = !take_worktree_changes && !refresh_only;
        require_pathspec = !(take_worktree_changes || (0 < addremove_explicit));
 
-       hold_locked_index(&lock_file, 1);
+       hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
 
        flags = ((verbose ? ADD_CACHE_VERBOSE : 0) |
                 (show_only ? ADD_CACHE_PRETEND : 0) |