]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-apply.c
Merge branch 'jn/web'
[git.git] / builtin-apply.c
index be2c7152cd7ee8c8076cd4bbd5660dd2f85b0fd1..9cf477c701d3224efe86418113691768410beae9 100644 (file)
@@ -2234,12 +2234,9 @@ static int apply_patch(int fd, const char *filename,
                apply = 0;
 
        write_index = check_index && apply;
-       if (write_index && newfd < 0) {
+       if (write_index && newfd < 0)
                newfd = hold_lock_file_for_update(&lock_file,
-                                                 get_index_file());
-               if (newfd < 0)
-                       die("unable to create new index file");
-       }
+                                                 get_index_file(), 1);
        if (check_index) {
                if (read_cache() < 0)
                        die("unable to read index file");