Skip to content

Commit 21deee3

Browse files
committed
Merge branch 'js/submodule-in-excluded' into maint
"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
2 parents a9749b0 + fadb482 commit 21deee3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
13921392
if (!(dir->flags & DIR_NO_GITLINKS)) {
13931393
unsigned char sha1[20];
13941394
if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0)
1395-
return path_untracked;
1395+
return exclude ? path_excluded : path_untracked;
13961396
}
13971397
return path_recurse;
13981398
}

t/t7061-wtstatus-ignore.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,15 @@ test_expect_success 'status ignored tracked directory with uncommitted file in t
272272
test_cmp expected actual
273273
'
274274

275+
cat >expected <<\EOF
276+
!! tracked/submodule/
277+
EOF
278+
279+
test_expect_success 'status ignores submodule in excluded directory' '
280+
git init tracked/submodule &&
281+
test_commit -C tracked/submodule initial &&
282+
git status --porcelain --ignored -u tracked/submodule >actual &&
283+
test_cmp expected actual
284+
'
285+
275286
test_done

0 commit comments

Comments
 (0)