From: Ben Wijen Date: Wed, 01 Jul 2020 09:36:52 GMT Subject: [PATCH 1/2] git clone: check for non-empty directory Message-ID: <20200701093653.3706-2-ben@wijen.net> In-Reply-To: <20200701093653.3706-1-ben@wijen.net> When using git clone with --separate-git-dir realgitdir and realgitdir already exists, it's content is destroyed. Extend test to make sure content is left intact Signed-off-by: Ben Wijen --- t/t5601-clone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 84ea2a3eb7..03901c55f2 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -271,7 +271,8 @@ test_expect_success 'fetch from gitfile parent' ' test_expect_success 'clone separate gitdir where target already exists' ' rm -rf dst && - test_must_fail git clone --separate-git-dir realgitdir src dst + test_must_fail git clone --separate-git-dir realgitdir src dst && + test -f realgitdir/config ' test_expect_success 'clone --reference from original' ' -- 2.27.0