[PATCH 2/3] t7406-submodule-update: demonstrate behaviour when run without init beforehand

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

 



Signed-off-by: Tay Ray Chuan <rctay89@xxxxxxxxx>
---
 t/t7406-submodule-update.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index f0b3305..00475eb 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -66,6 +66,26 @@ test_expect_success 'setup a submodule tree' '
 	)
 '
 
+test_expect_success 'setup a repo with uninitialized submodules' '
+	git clone super super2
+'
+
+test_expect_success 'submodule update <path> warns without init beforehand' '
+	(cd super2 &&
+	 test -n "$(git submodule update submodule)"
+	)
+'
+
+test_expect_success 'submodule update is silent without init beforehand' '
+	(cd super2 &&
+	 test -z "$(git submodule update)"
+	)
+'
+
+test_expect_success 'cleanup repo with uninitialized submodules' '
+	rm -rf super2
+'
+
 test_expect_success 'submodule update detaching the HEAD ' '
 	(cd super/submodule &&
 	 git reset --hard HEAD~1
-- 
1.8.4.rc4.527.g303b16c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]