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>
Mike Hommey committed
Nov 3, 2007 at 12:23 UTC
7d8ae93292e2cd862359f02879a0c954faf8afa8
1 file changed
+2
-5
builtin-ls-files.c
+2
-5
@@ -525,11 +525,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
525
break;
526
}
527
528
- if (require_work_tree && !is_inside_work_tree()) {
529
- const char *work_tree = get_git_work_tree();
530
- if (!work_tree || chdir(work_tree))
531
- die("This operation must be run in a work tree");
532
- }
528
+ if (require_work_tree && !is_inside_work_tree())
529
+ setup_work_tree();
530
531
pathspec = get_pathspec(prefix, argv + i);
532