diff options
Diffstat (limited to 't/t4027-diff-submodule.sh')
-rwxr-xr-x | t/t4027-diff-submodule.sh | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh index 2ffd11a142..9aa8e2b39b 100755 --- a/t/t4027-diff-submodule.sh +++ b/t/t4027-diff-submodule.sh @@ -31,7 +31,7 @@ test_expect_success setup ' cd sub && git rev-list HEAD ) && - echo ":160000 160000 $3 $_z40 M sub" >expect && + echo ":160000 160000 $3 $ZERO_OID M sub" >expect && subtip=$3 subprev=$2 ' @@ -104,19 +104,19 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)' expect_from_to >expect.body $subprev $subprev-dirty && test_cmp expect.body actual.body && git diff --ignore-submodules HEAD >actual2 && - ! test -s actual2 && + test_must_be_empty actual2 && git diff --ignore-submodules=untracked HEAD >actual3 && sed -e "1,/^@@/d" actual3 >actual3.body && expect_from_to >expect.body $subprev $subprev-dirty && test_cmp expect.body actual3.body && git diff --ignore-submodules=dirty HEAD >actual4 && - ! test -s actual4 + test_must_be_empty actual4 ' 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 && + test_must_be_empty actual && git config --add -f .gitmodules submodule.subname.ignore none && git config --add -f .gitmodules submodule.subname.path sub && git diff HEAD >actual && @@ -126,7 +126,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) git config -f .gitmodules submodule.subname.ignore all && git config -f .gitmodules submodule.subname.path sub && git diff HEAD >actual2 && - ! test -s actual2 && + test_must_be_empty actual2 && git config -f .gitmodules submodule.subname.ignore untracked && git diff HEAD >actual3 && sed -e "1,/^@@/d" actual3 >actual3.body && @@ -134,7 +134,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) test_cmp expect.body actual3.body && git config -f .gitmodules submodule.subname.ignore dirty && git diff HEAD >actual4 && - ! test -s actual4 && + test_must_be_empty actual4 && git config submodule.subname.ignore none && git config submodule.subname.path sub && git diff HEAD >actual && @@ -172,24 +172,24 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match)' expect_from_to >expect.body $subprev $subprev-dirty && test_cmp expect.body actual.body && git diff --ignore-submodules=all HEAD >actual2 && - ! test -s actual2 && + test_must_be_empty actual2 && git diff --ignore-submodules=untracked HEAD >actual3 && - ! test -s actual3 && + test_must_be_empty actual3 && git diff --ignore-submodules=dirty HEAD >actual4 && - ! test -s actual4 + test_must_be_empty actual4 ' test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match) [.gitmodules]' ' git config --add -f .gitmodules submodule.subname.ignore all && git config --add -f .gitmodules submodule.subname.path sub && git diff HEAD >actual2 && - ! test -s actual2 && + test_must_be_empty actual2 && git config -f .gitmodules submodule.subname.ignore untracked && git diff HEAD >actual3 && - ! test -s actual3 && + test_must_be_empty actual3 && git config -f .gitmodules submodule.subname.ignore dirty && git diff HEAD >actual4 && - ! test -s actual4 && + test_must_be_empty actual4 && git config submodule.subname.ignore none && git config submodule.subname.path sub && git diff HEAD >actual && @@ -211,7 +211,7 @@ 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 + test_must_be_empty actual ' test_expect_success 'git diff between submodule commits [.gitmodules]' ' @@ -227,7 +227,7 @@ 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 && + test_must_be_empty actual && git config submodule.subname.ignore dirty && git config submodule.subname.path sub && git diff HEAD^..HEAD >actual && @@ -239,10 +239,9 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' ' ' test_expect_success 'git diff (empty submodule dir)' ' - : >empty && rm -rf sub/* sub/.git && git diff > actual.empty && - test_cmp empty actual.empty + test_must_be_empty actual.empty ' test_expect_success 'conflicted submodule setup' ' @@ -250,7 +249,7 @@ test_expect_success 'conflicted submodule setup' ' # 39 efs c=fffffffffffffffffffffffffffffffffffffff && ( - echo "000000 $_z40 0 sub" && + echo "000000 $ZERO_OID 0 sub" && echo "160000 1$c 1 sub" && echo "160000 2$c 2 sub" && echo "160000 3$c 3 sub" @@ -265,7 +264,7 @@ index 2ffffff,3ffffff..0000000 ++Subproject commit 0000000000000000000000000000000000000000'\'' && hh=$(git rev-parse HEAD) && - sed -e "s/$_z40/$hh/" expect.nosub >expect.withsub + sed -e "s/$ZERO_OID/$hh/" expect.nosub >expect.withsub ' |