]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-checkout-index.c
Merge branch 'ar/autospell'
[git.git] / builtin-checkout-index.c
index 70d619da8d051f8d739911cfbbf8a5255787ec07..90f8523eb5c92555637c99f0fe52925a3ef7d09e 100644 (file)
@@ -154,7 +154,7 @@ static void checkout_all(const char *prefix, int prefix_length)
 }
 
 static const char checkout_cache_usage[] =
-"git-checkout-index [-u] [-q] [-a] [-f] [-n] [--stage=[123]|all] [--prefix=<string>] [--temp] [--] <file>...";
+"git checkout-index [-u] [-q] [-a] [-f] [-n] [--stage=[123]|all] [--prefix=<string>] [--temp] [--] <file>...";
 
 static struct lock_file lock_file;
 
@@ -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;
        }
@@ -258,9 +258,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                const char *p;
 
                if (all)
-                       die("git-checkout-index: don't mix '--all' and explicit filenames");
+                       die("git checkout-index: don't mix '--all' and explicit filenames");
                if (read_from_stdin)
-                       die("git-checkout-index: don't mix '--stdin' and explicit filenames");
+                       die("git checkout-index: don't mix '--stdin' and explicit filenames");
                p = prefix_path(prefix, prefix_length, arg);
                checkout_file(p, prefix_length);
                if (p < arg || p > arg + strlen(arg))
@@ -271,7 +271,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                struct strbuf buf, nbuf;
 
                if (all)
-                       die("git-checkout-index: don't mix '--all' and '--stdin'");
+                       die("git checkout-index: don't mix '--all' and '--stdin'");
 
                strbuf_init(&buf, 0);
                strbuf_init(&nbuf, 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;
 }