提交 7d8ae932 编写于 作者: M Mike Hommey 提交者: Junio C Hamano

Use setup_work_tree() in builtin-ls-files.c

Signed-off-by: NMike Hommey <mh@glandium.org>
Acked-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 59f0f2f3
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册