summaryrefslogtreecommitdiff
path: root/builtin-ls-files.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2007-11-03 12:23:12 +0100
committerJunio C Hamano <gitster@pobox.com>2007-11-05 22:47:57 -0800
commit7d8ae93292e2cd862359f02879a0c954faf8afa8 (patch)
treeec204290b0be4259b79efb09c056c77665c38aa8 /builtin-ls-files.c
parent59f0f2f33a420e9a14bb8cef20d38f508f0d098e (diff)
downloadgit-7d8ae93292e2cd862359f02879a0c954faf8afa8.tar.gz
Use setup_work_tree() in builtin-ls-files.c
Signed-off-by: Mike Hommey <mh@glandium.org> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-ls-files.c')
-rw-r--r--builtin-ls-files.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index b70da1863b..e0b856f432 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -525,11 +525,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
break;
}
- if (require_work_tree && !is_inside_work_tree()) {
- const char *work_tree = get_git_work_tree();
- if (!work_tree || chdir(work_tree))
- die("This operation must be run in a work tree");
- }
+ if (require_work_tree && !is_inside_work_tree())
+ setup_work_tree();
pathspec = get_pathspec(prefix, argv + i);