path: root/t
diff options
authorJunio C Hamano <>2011-08-23 01:05:15 (GMT)
committerJunio C Hamano <>2011-08-23 01:57:20 (GMT)
commitdbc92b072dd7023f8ba1f682a8060022fc72504a (patch)
tree2b935124666866f9d8b9702ad60a123962c4a26c /t
parentf696543dad6c7ba27b0c4fab167a5687263a9ba0 (diff)
clone: allow more than one --reference
Also add a test to expose a long-standing bug that is triggered when cloning with --reference option from a local repository that has its own alternates. The alternate object stores specified on the command line are lost, and only alternates copied from the source repository remain. The bug will be fixed in the next patch. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
1 files changed, 15 insertions, 0 deletions
diff --git a/t/ b/t/
index 151ea53..0163ad1 100755
--- a/t/
+++ b/t/
@@ -207,4 +207,19 @@ test_expect_success 'clone separate gitdir where target already exists' '
test_must_fail git clone --separate-git-dir realgitdir src dst
+test_expect_failure 'clone --reference from original' '
+ git clone --shared --bare src src-1 &&
+ git clone --bare src src-2 &&
+ git clone --reference=src-2 --bare src-1 target-8 &&
+ grep /src-2/ target-8/objects/info/alternates
+test_expect_success 'clone with more than one --reference' '
+ git clone --bare src src-3 &&
+ git clone --bare src src-4 &&
+ git clone --reference=src-3 --reference=src-4 src target-9 &&
+ grep /src-3/ target-9/.git/objects/info/alternates &&
+ grep /src-4/ target-9/.git/objects/info/alternates