]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-apply.c
Merge git://git.kernel.org/pub/scm/gitk/gitk
[git.git] / builtin-apply.c
index 5e3b4a14470ba1e97d98dd1721d9d4f6c44d6dc8..15432b6782400b556333ee4117c7daaff20412ab 100644 (file)
@@ -2907,7 +2907,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
                            whitespace_error,
                            whitespace_error == 1 ? "" : "s",
                            whitespace_error == 1 ? "s" : "");
-               if (applied_after_fixing_ws)
+               if (applied_after_fixing_ws && apply)
                        fprintf(stderr, "warning: %d line%s applied after"
                                " fixing whitespace errors.\n",
                                applied_after_fixing_ws,
@@ -2921,7 +2921,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
 
        if (update_index) {
                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");
        }