Code

git-clone: aggressively optimize local clone behaviour.
[git.git] / t / t5701-clone-local.sh
index b0933274db4ee73341bcc55e7d98fcddc3bae920..a3026ec4fcc653ff6a5a14bd84c1b3cc92078b6b 100755 (executable)
@@ -43,4 +43,21 @@ test_expect_success 'local clone from x.git that does not exist' '
        fi
 '
 
+test_expect_success 'With -no-hardlinks, local will make a copy' '
+       cd "$D" &&
+       git clone --bare --no-hardlinks x w &&
+       cd w &&
+       linked=$(find objects -type f ! -links 1 | wc -l) &&
+       test "$linked" = 0
+'
+
+test_expect_success 'Even without -l, local will make a hardlink' '
+       cd "$D" &&
+       rm -fr w &&
+       git clone -l --bare x w &&
+       cd w &&
+       copied=$(find objects -type f -links 1 | wc -l) &&
+       test "$copied" = 0
+'
+
 test_done