From 271bb08735435b859464c22506ba512f003a4191 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sat, 3 Nov 2007 12:23:13 +0100 Subject: Don't always require working tree for git-rm This allows to do git rm --cached -r directory, instead of git ls-files -z directory | git update-index --remove -z --stdin. This can be particularly useful for git-filter-branch users. Signed-off-by: Mike Hommey Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-rm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin-rm.c') diff --git a/builtin-rm.c b/builtin-rm.c index bca2bd9703..a3d25e6a57 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -155,6 +155,9 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (!argc) usage_with_options(builtin_rm_usage, builtin_rm_options); + if (!index_only) + setup_work_tree(); + pathspec = get_pathspec(prefix, argv); seen = NULL; for (i = 0; pathspec[i] ; i++) -- cgit v1.2.3