X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-checkout-index.c;h=7e42024c67a2c0fda72f94935b7d5a723c73d131;hb=81a24b52c164b96d37c8c50799a624e2e8ce8a57;hp=e6264c4bf0ef537ea7ea2127133d1fad5a33b7d6;hpb=7fb1011e610a28518959b1d2d48cea17ecc32048;p=git.git diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index e6264c4bf..7e42024c6 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -66,9 +66,7 @@ static void write_tempfile_record(const char *name, int prefix_length) fputs(topath[checkout_stage], stdout); putchar('\t'); - write_name_quoted("", 0, name + prefix_length, - line_termination, stdout); - putchar(line_termination); + write_name_quoted(name + prefix_length, stdout, line_termination); for (i = 0; i < 4; i++) { topath[i][0] = 0; @@ -248,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; } @@ -299,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; }