diff options
author | Aaron Schrab <aaron@schrab.com> | 2013-04-09 18:22:00 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-09 15:40:00 -0700 |
commit | b552b56df2c13885a67ca9ec9f76c21d3b7e2cde (patch) | |
tree | 5c6d062ab0f30792e6ec97e08d402f85299abd7d /t/t5700-clone-reference.sh | |
parent | 0658569eb03e743ef46abd06abd9d0d81d53e72c (diff) | |
download | git-b552b56df2c13885a67ca9ec9f76c21d3b7e2cde.tar.gz |
clone: Allow repo using gitfile as a reference
Try reading gitfile files when processing --reference options to clone.
This will allow, among other things, using a submodule checked out with
a recent version of git as a reference repository without requiring the
user to have internal knowledge of submodule layout.
Signed-off-by: Aaron Schrab <aaron@schrab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5700-clone-reference.sh')
-rwxr-xr-x | t/t5700-clone-reference.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh index 60f1552ade..6537911a43 100755 --- a/t/t5700-clone-reference.sh +++ b/t/t5700-clone-reference.sh @@ -185,4 +185,17 @@ test_expect_success 'fetch with incomplete alternates' ' ! grep " want $tag_object" "$U.K" ' +test_expect_success 'clone using repo with gitfile as a reference' ' + git clone --separate-git-dir=L A M && + git clone --reference=M A N && + echo "$base_dir/L/objects" >expected && + test_cmp expected "$base_dir/N/.git/objects/info/alternates" +' + +test_expect_success 'clone using repo pointed at by gitfile as reference' ' + git clone --reference=M/.git A O && + echo "$base_dir/L/objects" >expected && + test_cmp expected "$base_dir/O/.git/objects/info/alternates" +' + test_done |