summaryrefslogtreecommitdiff
path: root/t/t7502-status.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2008-10-16 11:07:26 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-10-17 12:46:59 -0700
commit98fa473887d0bebd38d568bb07232a336a642dcf (patch)
treebce65b20193d1fc4f51ca64d6bdad4718609ff29 /t/t7502-status.sh
parentt1301-shared-repo.sh: don't let a default ACL interfere with the test (diff)
downloadtgif-98fa473887d0bebd38d568bb07232a336a642dcf.tar.xz
refactor handling of "other" files in ls-files and status
When the "git status" display code was originally converted to C, we copied the code from ls-files to discover whether a pathname returned by read_directory was an "other", or untracked, file. Much later, 5698454e updated the code in ls-files to handle some new cases caused by gitlinks. This left the code in wt-status.c broken: it would display submodule directories as untracked directories. Nobody noticed until now, however, because unless status.showUntrackedFiles was set to "all", submodule directories were not actually reported by read_directory. So the bug was only triggered in the presence of a submodule _and_ this config option. This patch pulls the ls-files code into a new function, cache_name_is_other, and uses it in both places. This should leave the ls-files functionality the same and fix the bug in status. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-status.sh')
-rwxr-xr-xt/t7502-status.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index c8e4c2e7b4..187a13e64f 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -285,6 +285,12 @@ test_expect_success 'status submodule summary is disabled by default' '
test_cmp expect output
'
+# we expect the same as the previous test
+test_expect_success 'status --untracked-files=all does not show submodule' '
+ git status --untracked-files=all >output &&
+ test_cmp expect output
+'
+
head=$(cd sm && git rev-parse --short=7 --verify HEAD)
cat >expect <<EOF