summaryrefslogtreecommitdiff
path: root/builtin-rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-rm.c')
-rw-r--r--builtin-rm.c3
1 files changed, 3 insertions, 0 deletions
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++)