Skip to content
Permalink
Browse files

Merge pull request #1179 from dscho/submodule-in-excluded

status: do not get confused by submodules in excluded directories
  • Loading branch information...
dscho committed May 25, 2017
2 parents abd867d + 6eb92ce commit 51efe4db8841866f2fe7a4aafb7b32e71e23defd
Showing with 15 additions and 1 deletion.
  1. +1 −1 dir.c
  2. +14 −0 t/t7061-wtstatus-ignore.sh
2 dir.c
@@ -1362,7 +1362,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;
}
@@ -271,4 +271,18 @@ 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 &&
(
cd tracked/submodule &&
test_commit initial
) &&
git status --porcelain --ignored -u tracked/submodule >actual &&
test_cmp expected actual
'

test_done

0 comments on commit 51efe4d

Please sign in to comment.
You can’t perform that action at this time.