t9903: add tests for git-prompt pcmode
[gitweb.git] / t / t4027-diff-submodule.sh
index 1bc6e77a0d5914a7cbf0986bdabc44697e334c27..518bf9524e0b55181f3c440d202b69c12a0b314f 100755 (executable)
@@ -5,7 +5,6 @@ test_description='difference in submodules'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh
 
-_z40=0000000000000000000000000000000000000000
 test_expect_success setup '
        test_tick &&
        test_create_repo sub &&
@@ -115,6 +114,9 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'
 '
 
 test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.git/config]' '
+       git config diff.ignoreSubmodules all &&
+       git diff HEAD >actual &&
+       ! test -s actual &&
        git config submodule.subname.ignore none &&
        git config submodule.subname.path sub &&
        git diff HEAD >actual &&
@@ -136,10 +138,14 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
        sed -e "1,/^@@/d" actual >actual.body &&
        expect_from_to >expect.body $subprev $subprev-dirty &&
        test_cmp expect.body actual.body &&
-       git config --remove-section submodule.subname
+       git config --remove-section submodule.subname &&
+       git config --unset diff.ignoreSubmodules
 '
 
 test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.gitmodules]' '
+       git config diff.ignoreSubmodules dirty &&
+       git diff HEAD >actual &&
+       ! test -s actual &&
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sub &&
        git diff HEAD >actual &&
@@ -166,6 +172,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
        test_cmp expect.body actual.body &&
        git config --remove-section submodule.subname &&
        git config --remove-section -f .gitmodules submodule.subname &&
+       git config --unset diff.ignoreSubmodules &&
        rm .gitmodules
 '
 
@@ -308,11 +315,11 @@ test_expect_success 'git diff (empty submodule dir)' '
 test_expect_success 'conflicted submodule setup' '
 
        # 39 efs
-       c=fffffffffffffffffffffffffffffffffffffff
+       c=fffffffffffffffffffffffffffffffffffffff &&
        (
-               echo "000000 $_z40 0    sub"
-               echo "160000 1$c 1      sub"
-               echo "160000 2$c 2      sub"
+               echo "000000 $_z40 0    sub" &&
+               echo "160000 1$c 1      sub" &&
+               echo "160000 2$c 2      sub" &&
                echo "160000 3$c 3      sub"
        ) | git update-index --index-info &&
        echo >expect.nosub '\''diff --cc sub