init, clone: support --separate-git-dir for .git file
[gitweb.git] / t / t5601-clone.sh
index 987e0c846309a8a49dbe31ce292edd55342217b3..c467b6797e61fc65c1780d200a0465f13e5fb74d 100755 (executable)
@@ -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