Add `init.templatedir` configuration variable.
[gitweb.git] / builtin-rm.c
index 269d60890ac6732f05b835e88bdb60a10bb3d441..f3772c84de0a1f1a18123e55ae6e6983739f590b 100644 (file)
@@ -157,7 +157,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        git_config(git_default_config, NULL);
 
-       argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
+       argc = parse_options(argc, argv, prefix, builtin_rm_options,
+                            builtin_rm_usage, 0);
        if (!argc)
                usage_with_options(builtin_rm_usage, builtin_rm_options);
 
@@ -168,9 +169,10 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        if (read_cache() < 0)
                die("index file corrupt");
-       refresh_cache(REFRESH_QUIET);
 
        pathspec = get_pathspec(prefix, argv);
+       refresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL);
+
        seen = NULL;
        for (i = 0; pathspec[i] ; i++)
                /* nothing */;
@@ -256,7 +258,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
                                continue;
                        }
                        if (!removed)
-                               die("git rm: %s: %s", path, strerror(errno));
+                               die_errno("git rm: '%s'", path);
                }
        }