builtin-apply: Show a more descriptive error on failure when opening a patch
[gitweb.git] / builtin-add.c
index 5c29cc2f3f680e4dee19b040e647dd8b014cf10d..4a91e3eb118850882fbc22e8d8f37e8bbfaa7617 100644 (file)
@@ -259,7 +259,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
  finish:
        if (active_cache_changed) {
                if (write_cache(newfd, active_cache, active_nr) ||
-                   close(newfd) || commit_locked_index(&lock_file))
+                   commit_locked_index(&lock_file))
                        die("Unable to write new index file");
        }