[PATCH 2/2] t7411: test lookup of uninitialized submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes we need to lookup information of uninitialized submodules. Make
sure that works.

Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
---
 t/t7411-submodule-config.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index 3646f28b40..b40df6a4c1 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -126,6 +126,27 @@ test_expect_success 'reading of local configuration' '
 	)
 '
 
+cat >super/expect_url <<EOF
+Submodule url: '../submodule' for path 'b'
+Submodule url: 'git@xxxxxxxxxxxxxxxxxx:submodule.git' for path 'submodule'
+EOF
+
+test_expect_success 'reading of local configuration for uninitialized submodules' '
+	(
+		cd super &&
+		git submodule deinit -f b &&
+		old_submodule=$(git config submodule.submodule.url) &&
+		git config submodule.submodule.url git@xxxxxxxxxxxxxxxxxx:submodule.git &&
+		test-submodule-config --url \
+			"" b \
+			"" submodule \
+				>actual &&
+		test_cmp expect_url actual &&
+		git config submodule.submodule.url "$old_submodule" &&
+		git submodule init b
+	)
+'
+
 cat >super/expect_fetchrecurse_die.err <<EOF
 fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
 EOF
-- 
2.11.0.rc2.50.g8bda6b2.dirty




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]