diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2013-12-04 23:19:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-06 12:56:12 -0800 |
commit | 5f3eb7674082a52dea6c6252752509b05a3bfe0a (patch) | |
tree | ec0f2b95958699a94a2375f8c9c5493ea6d09260 /t/t4027-diff-submodule.sh | |
parent | 8ea31d279681533c0b4c8eb1d61b18e95da55df0 (diff) | |
download | git-hv/submodule-ignore-fix.tar.gz |
disable complete ignorance of submodules for index <-> HEAD diffhv/submodule-ignore-fix
If the value of ignore for submodules is set to "all" we would not show
whats actually committed during status or diff. This can result in the
user committing unexpected submodule references. Lets be nicer and always
show whats in the index.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4027-diff-submodule.sh')
-rwxr-xr-x | t/t4027-diff-submodule.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh index 518bf9524e..bd84ea7c7f 100755 --- a/t/t4027-diff-submodule.sh +++ b/t/t4027-diff-submodule.sh @@ -258,7 +258,9 @@ test_expect_success 'git diff between submodule commits' ' expect_from_to >expect.body $subtip $subprev && test_cmp expect.body actual.body && git diff --ignore-submodules HEAD^..HEAD >actual && - ! test -s actual + sed -e "1,/^@@/d" actual >actual.body && + expect_from_to >expect.body $subtip $subprev && + test_cmp expect.body actual.body ' test_expect_success 'git diff between submodule commits [.git/config]' ' @@ -274,7 +276,9 @@ test_expect_success 'git diff between submodule commits [.git/config]' ' test_cmp expect.body actual.body && git config submodule.subname.ignore all && git diff HEAD^..HEAD >actual && - ! test -s actual && + sed -e "1,/^@@/d" actual >actual.body && + expect_from_to >expect.body $subtip $subprev && + test_cmp expect.body actual.body && git diff --ignore-submodules=dirty HEAD^..HEAD >actual && sed -e "1,/^@@/d" actual >actual.body && expect_from_to >expect.body $subtip $subprev && @@ -294,7 +298,9 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' ' test_cmp expect.body actual.body && git config -f .gitmodules submodule.subname.ignore all && git diff HEAD^..HEAD >actual && - ! test -s actual && + sed -e "1,/^@@/d" actual >actual.body && + expect_from_to >expect.body $subtip $subprev && + test_cmp expect.body actual.body && git config submodule.subname.ignore dirty && git config submodule.subname.path sub && git diff HEAD^..HEAD >actual && |