Propagate -u/--upload-pack option of "git clone" to transport.
[git.git] / builtin-rm.c
index a3d25e6a571584c486d252c5a8e2b182f3da86e3..abdab7f001587e819aecb5c5f7e8dcbb10a5dd48 100644 (file)
@@ -144,12 +144,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
        const char **pathspec;
        char *seen;
 
-       git_config(git_default_config);
-
-       newfd = hold_locked_index(&lock_file, 1);
-
-       if (read_cache() < 0)
-               die("index file corrupt");
+       git_config(git_default_config, NULL);
 
        argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
        if (!argc)
@@ -158,6 +153,11 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
        if (!index_only)
                setup_work_tree();
 
+       newfd = hold_locked_index(&lock_file, 1);
+
+       if (read_cache() < 0)
+               die("index file corrupt");
+
        pathspec = get_pathspec(prefix, argv);
        seen = NULL;
        for (i = 0; pathspec[i] ; i++)
@@ -250,7 +250,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        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");
        }