From: Tay Ray Chuan Date: Sun, 15 Sep 2013 17:38:22 GMT Subject: [PATCH 2/3] t7406-submodule-update: demonstrate behaviour when run without init beforehand Message-ID: <1379266703-29808-2-git-send-email-rctay89@gmail.com> In-Reply-To: <1379266703-29808-1-git-send-email-rctay89@gmail.com> Signed-off-by: Tay Ray Chuan --- 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 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