Signed-off-by: Tay Ray Chuan <rcta...@gmail.com>
---
 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to