From b57fb80a7d7d19102b31ab94a28ed43ea1ee07bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 19 Mar 2011 22:16:56 +0700 Subject: init, clone: support --separate-git-dir for .git file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --separate-git-dir tells git to create git dir at the specified location, instead of where it is supposed to be. A .git file that points to that location will be put in place so that it appears normal to repo discovery process. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t5601-clone.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 't/t5601-clone.sh') diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 987e0c846..c467b6797 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -192,4 +192,17 @@ test_expect_success 'do not respect url-encoding of non-url path' ' git clone x+y xy-regular ' +test_expect_success 'clone separate gitdir' ' + rm -rf dst && + git clone --separate-git-dir realgitdir src dst && + echo "gitdir: `pwd`/realgitdir" >expected && + test_cmp expected dst/.git && + test -d realgitdir/refs +' + +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_done -- cgit v1.2.1