aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-23 14:27:33 -0700
committerJunio C Hamano <gitster@pobox.com>2011-09-23 14:27:33 -0700
commit84b051462fcaf9892f31f178a47c261ddd5c9695 (patch)
tree32d2ed754ed0948d261e3b16023f68e42854fe82 /t
parent406c1c4dd4a8f0fac3fddce1e7bb3b66af835e6a (diff)
parente6baf4a1ae1bb75d59967066ade1290cf105dcd8 (diff)
downloadgit-84b051462fcaf9892f31f178a47c261ddd5c9695.tar.gz
git-84b051462fcaf9892f31f178a47c261ddd5c9695.tar.xz
Merge branch 'jc/maint-clone-alternates' into maint
* jc/maint-clone-alternates: clone: clone from a repository with relative alternates clone: allow more than one --reference
Diffstat (limited to 't')
-rwxr-xr-xt/t5601-clone.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 501bd3fb6..e8103144b 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -211,4 +211,27 @@ test_expect_success 'clone separate gitdir where target already exists' '
test_must_fail git clone --separate-git-dir realgitdir src dst
'
+test_expect_success '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
+'
+
+test_expect_success 'clone from original with relative alternate' '
+ mkdir nest &&
+ git clone --bare src nest/src-5 &&
+ echo ../../../src/.git/objects >nest/src-5/objects/info/alternates &&
+ git clone --bare nest/src-5 target-10 &&
+ grep /src/\\.git/objects target-10/objects/info/alternates
+'
+
test_done