Commit 188dce13 authored by Brandon Williams's avatar Brandon Williams Committed by Junio C Hamano

ls-files: use repository object

Convert ls-files to use a repository struct and recurse submodules
inprocess.
Signed-off-by: default avatarBrandon Williams <bmwill@google.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 96dc883b
This diff is collapsed.
......@@ -400,7 +400,7 @@ static struct cmd_struct commands[] = {
{ "init-db", cmd_init_db },
{ "interpret-trailers", cmd_interpret_trailers, RUN_SETUP_GENTLY },
{ "log", cmd_log, RUN_SETUP },
{ "ls-files", cmd_ls_files, RUN_SETUP | SUPPORT_SUPER_PREFIX },
{ "ls-files", cmd_ls_files, RUN_SETUP },
{ "ls-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
{ "ls-tree", cmd_ls_tree, RUN_SETUP },
{ "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY },
......
......@@ -135,6 +135,45 @@ test_expect_success '--recurse-submodules and pathspecs setup' '
test_cmp expect actual
'
test_expect_success 'inactive submodule' '
test_when_finished "git config --bool submodule.submodule.active true" &&
test_when_finished "git -C submodule config --bool submodule.subsub.active true" &&
git config --bool submodule.submodule.active "false" &&
cat >expect <<-\EOF &&
.gitmodules
a
b/b
h.txt
sib/file
sub/file
submodule
EOF
git ls-files --recurse-submodules >actual &&
test_cmp expect actual &&
git config --bool submodule.submodule.active "true" &&
git -C submodule config --bool submodule.subsub.active "false" &&
cat >expect <<-\EOF &&
.gitmodules
a
b/b
h.txt
sib/file
sub/file
submodule/.gitmodules
submodule/c
submodule/f.TXT
submodule/g.txt
submodule/subsub
EOF
git ls-files --recurse-submodules >actual &&
test_cmp expect actual
'
test_expect_success '--recurse-submodules and pathspecs' '
cat >expect <<-\EOF &&
h.txt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment