X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-checkout-index.c;h=eb1fc9aa6f7f61a817a198feaf94ca9d983eb14b;hb=cc3b7a9732f940cb0249a12cb3c02e3d83723eb0;hp=70d619da8d051f8d739911cfbbf8a5255787ec07;hpb=bd6ba4d28bf75b0857b3c81aa8bca8e454d9e79e;p=git.git diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index 70d619da8..eb1fc9aa6 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -166,7 +166,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) int read_from_stdin = 0; int prefix_length; - git_config(git_default_config); + git_config(git_default_config, NULL); state.base_dir = ""; prefix_length = prefix ? strlen(prefix) : 0; @@ -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; }