diff options
Diffstat (limited to 't/t4041-diff-submodule-option.sh')
-rwxr-xr-x | t/t4041-diff-submodule-option.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index f852136585..0c1502d4b0 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -9,6 +9,9 @@ test_description='Support for verbose submodule differences in git diff This test tries to verify the sanity of the --submodule option of git diff. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Tested non-UTF-8 encoding @@ -262,7 +265,7 @@ test_expect_success 'submodule is up to date' ' test_expect_success 'submodule contains untracked content' ' echo new > sm1/new-file && - git diff-index -p --submodule=log HEAD >actual && + git diff-index -p --ignore-submodules=none --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains untracked content EOF @@ -270,7 +273,7 @@ test_expect_success 'submodule contains untracked content' ' ' test_expect_success 'submodule contains untracked content (untracked ignored)' ' - git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual && + git diff-index -p --submodule=log HEAD >actual && test_must_be_empty actual ' @@ -286,7 +289,7 @@ test_expect_success 'submodule contains untracked content (all ignored)' ' test_expect_success 'submodule contains untracked and modified content' ' echo new > sm1/foo6 && - git diff-index -p --submodule=log HEAD >actual && + git diff-index -p --ignore-submodules=none --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains untracked content Submodule sm1 contains modified content @@ -296,7 +299,7 @@ test_expect_success 'submodule contains untracked and modified content' ' test_expect_success 'submodule contains untracked and modified content (untracked ignored)' ' echo new > sm1/foo6 && - git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual && + git diff-index -p --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains modified content EOF @@ -337,7 +340,7 @@ test_expect_success 'submodule is modified' ' test_expect_success 'modified submodule contains untracked content' ' echo new > sm1/new-file && - git diff-index -p --submodule=log HEAD >actual && + git diff-index -p --ignore-submodules=none --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains untracked content Submodule sm1 $head6..$head8: @@ -347,7 +350,7 @@ test_expect_success 'modified submodule contains untracked content' ' ' test_expect_success 'modified submodule contains untracked content (untracked ignored)' ' - git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual && + git diff-index -p --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 $head6..$head8: > change @@ -371,7 +374,7 @@ test_expect_success 'modified submodule contains untracked content (all ignored) test_expect_success 'modified submodule contains untracked and modified content' ' echo modification >> sm1/foo6 && - git diff-index -p --submodule=log HEAD >actual && + git diff-index -p --ignore-submodules=none --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains untracked content Submodule sm1 contains modified content @@ -383,7 +386,7 @@ test_expect_success 'modified submodule contains untracked and modified content' test_expect_success 'modified submodule contains untracked and modified content (untracked ignored)' ' echo modification >> sm1/foo6 && - git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual && + git diff-index -p --submodule=log HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains modified content Submodule sm1 $head6..$head8: @@ -538,7 +541,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' ' (cd super && (cd sub && git fetch && - git checkout origin/master + git checkout origin/main ) && git diff --submodule > ../actual ) && |