summaryrefslogtreecommitdiff
path: root/t/t4027-diff-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-29 12:49:52 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-29 12:49:52 -0700
commit7dae8b21c2fe39a59661c709f0dc17090dafa5a4 (patch)
tree0063896a0043013e3b2ce8d3834586da5120d9d9 /t/t4027-diff-submodule.sh
parentc922b01f54c4bebe84daeacf014cfbc8dc68479b (diff)
downloadgit-7dae8b21c2fe39a59661c709f0dc17090dafa5a4.tar.gz
diff -c -p: do not die on submodules
The combine diff logic knew only about blobs (and their checked-out form in the work tree, either regular files or symlinks), and barfed when fed submodules. This "externalizes" gitlinks in the same way as the normal patch generation codepath does (i.e. "Subproject commit Xxx\n") to fix the issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4027-diff-submodule.sh')
-rwxr-xr-xt/t4027-diff-submodule.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index ba6679c6e4..718efe8077 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