X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=builtin-checkout-index.c;h=7e42024c67a2c0fda72f94935b7d5a723c73d131;hb=a41acc63badf20cbb22cca61039dca9309deaa19;hp=70d619da8d051f8d739911cfbbf8a5255787ec07;hpb=c78a24986d4d3faff810e87dbcd0ac99f0eabbce;p=git.git diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index 70d619da8..7e42024c6 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -246,8 +246,8 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) * want to update cache. */ if (state.refresh_cache) { - close(newfd); newfd = -1; rollback_lock_file(&lock_file); + newfd = -1; } state.refresh_cache = 0; } @@ -297,7 +297,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) if (0 <= newfd && (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"); return 0; }