mirror of
https://github.com/git/git
synced 2024-10-02 14:45:21 +00:00
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>
This commit is contained in:
parent
59f0f2f33a
commit
7d8ae93292
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue