X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4027-diff-submodule.sh;h=5cf8924b2163ec55328ce270911a23cdcf52634a;hb=f90cf2b9203e81e3a2b70b15480628e9189b7e60;hp=1c2edebb09bd6e1d7581365011c8500da57942c5;hpb=2990034f1ed2c3d85d23d5611a1f04d317f785ac;p=git.git diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh index 1c2edebb0..5cf8924b2 100755 --- a/t/t4027-diff-submodule.sh +++ b/t/t4027-diff-submodule.sh @@ -57,4 +57,43 @@ test_expect_success 'git diff (empty submodule dir)' ' test_cmp empty actual.empty ' +test_expect_success 'conflicted submodule setup' ' + + # 39 efs + c=fffffffffffffffffffffffffffffffffffffff + ( + 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 +index 2ffffff,3ffffff..0000000 +--- a/sub ++++ b/sub +@@@ -1,1 -1,1 +1,1 @@@ +- Subproject commit 2fffffffffffffffffffffffffffffffffffffff + -Subproject commit 3fffffffffffffffffffffffffffffffffffffff +++Subproject commit 0000000000000000000000000000000000000000'\'' && + + hh=$(git rev-parse HEAD) && + sed -e "s/$_z40/$hh/" expect.nosub >expect.withsub + +' + +test_expect_success 'combined (empty submodule)' ' + rm -fr sub && mkdir sub && + git diff >actual && + test_cmp expect.nosub actual +' + +test_expect_success 'combined (with submodule)' ' + rm -fr sub && + git clone --no-checkout . sub && + git diff >actual && + test_cmp expect.withsub actual +' + + + test_done