diff options
Diffstat (limited to 't/t4027-diff-submodule.sh')
-rwxr-xr-x | t/t4027-diff-submodule.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh index e29deaf4a5..94ef77e1df 100755 --- a/t/t4027-diff-submodule.sh +++ b/t/t4027-diff-submodule.sh @@ -3,10 +3,9 @@ test_description='difference in submodules' . ./test-lib.sh -. "$TEST_DIRECTORY"/diff-lib.sh +. "$TEST_DIRECTORY"/lib-diff.sh test_expect_success setup ' - test_oid_init && test_tick && test_create_repo sub && ( @@ -94,6 +93,14 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked)' ' ) && git diff HEAD >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 HEAD with dirty submodule (untracked) (none ignored)' ' + test_config diff.ignoreSubmodules none && + git diff HEAD >actual && + sed -e "1,/^@@/d" actual >actual.body && expect_from_to >expect.body $subtip $subprev-dirty && test_cmp expect.body actual.body ' @@ -169,13 +176,13 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match)' git clean -qfdx && >cruft ) && - git diff HEAD >actual && + git diff --ignore-submodules=none HEAD >actual && sed -e "1,/^@@/d" actual >actual.body && expect_from_to >expect.body $subprev $subprev-dirty && test_cmp expect.body actual.body && git diff --ignore-submodules=all HEAD >actual2 && test_must_be_empty actual2 && - git diff --ignore-submodules=untracked HEAD >actual3 && + git diff HEAD >actual3 && test_must_be_empty actual3 && git diff --ignore-submodules=dirty HEAD >actual4 && test_must_be_empty actual4 |