diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
| commit | 080627942802e767b068a491f3d349227f4e2cdc (patch) | |
| tree | e229ae62bfe315afc0d784b3752958f981b46d96 /t/t4027-diff-submodule.sh | |
| parent | dfcd90506998c1de8d8ef86431c86ef9ed626c30 (diff) | |
| parent | 8ef93124645f89c45c9ec3edd3b268b38154061a (diff) | |
| download | git-080627942802e767b068a491f3d349227f4e2cdc.tar.xz | |
Merge branch 'sj/untracked-files-in-submodule-directory-is-not-dirty'
"git diff" showed a submodule working tree with untracked cruft as
"Submodule commit <objectname>-dirty", but a natural expectation is
that the "-dirty" indicator would align with "git describe --dirty",
which does not consider having untracked files in the working tree
as source of dirtiness. The inconsistency has been fixed.
* sj/untracked-files-in-submodule-directory-is-not-dirty:
diff: do not show submodule with untracked files as "-dirty"
Diffstat (limited to 't/t4027-diff-submodule.sh')
| -rwxr-xr-x | t/t4027-diff-submodule.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh index d7145ccca4..894a11b224 100755 --- a/t/t4027-diff-submodule.sh +++ b/t/t4027-diff-submodule.sh @@ -93,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 ' @@ -168,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 |
