expect_from_to >expect.body $subprev $subprev-dirty &&
test_cmp expect.body actual.body &&
git diff --ignore-submodules HEAD >actual2 &&
- echo -n "" | test_cmp - actual2 &&
+ ! test -s 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 &&
- echo -n "" | test_cmp - actual4
+ ! test -s actual4
'
-test_done
+
test_expect_success 'git diff HEAD with dirty submodule (index, refs match)' '
(
cd sub &&
expect_from_to >expect.body $subprev $subprev-dirty &&
test_cmp expect.body actual.body &&
git diff --ignore-submodules=all HEAD >actual2 &&
- echo -n "" | test_cmp - actual2 &&
+ ! test -s actual2 &&
git diff --ignore-submodules=untracked HEAD >actual3 &&
- echo -n "" | test_cmp - actual3 &&
+ ! test -s actual3 &&
git diff --ignore-submodules=dirty HEAD >actual4 &&
- echo -n "" | test_cmp - actual4
+ ! test -s actual4
'
test_expect_success 'git diff (empty submodule dir)' '
test_expect_success 'submodule contains untracked content (untracked ignored)' "
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'submodule contains untracked content (dirty ignored)' "
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'submodule contains untracked content (all ignored)' "
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'submodule contains untracked and modifed content' "
test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' "
echo new > sm1/foo6 &&
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'submodule contains untracked and modifed content (all ignored)' "
echo new > sm1/foo6 &&
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'submodule contains modifed content' "
test_expect_success 'modified submodule contains untracked content (all ignored)' "
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'modified submodule contains untracked and modifed content' "
test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' "
echo modification >> sm1/foo6 &&
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
- echo -n '' | diff actual -
+ ! test -s actual
"
test_expect_success 'modified submodule contains modifed content' "