diff --git a/builtin-add.c b/builtin-add.c
index 5c29cc2f3f680e4dee19b040e647dd8b014cf10d..4a91e3eb118850882fbc22e8d8f37e8bbfaa7617 100644 (file)
--- a/builtin-add.c
+++ b/builtin-add.c
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");
}