"
commit_file sm1 &&
-cd sm1 &&
-git reset --hard HEAD~2 >/dev/null &&
-head3=$(git rev-parse --verify HEAD | cut -c1-7) &&
-cd ..
+head3=$(
+ cd sm1 &&
+ git reset --hard HEAD~2 >/dev/null &&
+ git rev-parse --verify HEAD | cut -c1-7
+)
test_expect_success 'modified submodule(backward)' "
git diff-index -p --submodule=log HEAD >actual &&
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' "