summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-06 05:11:26 +0100
committerJunio C Hamano <gitster@pobox.com>2017-11-06 05:11:26 +0100
commitda7996aaf75fcd58c0fb787c15ee9569140a2f9c (patch)
treed7f70aca35d260f801e61976e53a90ad6a7350e4
parentMerge branch 'ao/check-resolve-ref-unsafe-result' (diff)
parentstatus: do not get confused by submodules in excluded directories (diff)
downloadgit-da7996aaf75fcd58c0fb787c15ee9569140a2f9c.tar.xz
git-da7996aaf75fcd58c0fb787c15ee9569140a2f9c.zip
Merge branch 'js/submodule-in-excluded'
"git status --ignored -u" did not stop at a working tree of a separate project that is embedded in an ignored directory and listed files in that other project, instead of just showing the directory itself as ignored. * js/submodule-in-excluded: status: do not get confused by submodules in excluded directories
-rw-r--r--dir.c2
-rwxr-xr-xt/t7061-wtstatus-ignore.sh11
2 files changed, 12 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 1d17b800cf..9987011da5 100644
--- a/dir.c
+++ b/dir.c
@@ -1392,7 +1392,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
if (!(dir->flags & DIR_NO_GITLINKS)) {
unsigned char sha1[20];
if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0)
- return path_untracked;
+ return exclude ? path_excluded : path_untracked;
}
return path_recurse;
}
diff --git a/t/t7061-wtstatus-ignore.sh b/t/t7061-wtstatus-ignore.sh
index fc6013ba3c..0c394cf995 100755
--- a/t/t7061-wtstatus-ignore.sh
+++ b/t/t7061-wtstatus-ignore.sh
@@ -272,4 +272,15 @@ test_expect_success 'status ignored tracked directory with uncommitted file in t
test_cmp expected actual
'
+cat >expected <<\EOF
+!! tracked/submodule/
+EOF
+
+test_expect_success 'status ignores submodule in excluded directory' '
+ git init tracked/submodule &&
+ test_commit -C tracked/submodule initial &&
+ git status --porcelain --ignored -u tracked/submodule >actual &&
+ test_cmp expected actual
+'
+
test_done