summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:42:13 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:42:13 -0800
commitd35c8027937546e6b22a2f28123f731c84e3b380 (patch)
treeac634f285f6edfcc44430c03fd5bade5b62fce9d /t
parentMerge branch 'jc/checkout-local-track-report' (diff)
parentclone: --dissociate option to mark that reference is only temporary (diff)
downloadtgif-d35c8027937546e6b22a2f28123f731c84e3b380.tar.xz
Merge branch 'jc/clone-borrow'
Allow "git clone --reference" to be used more safely. * jc/clone-borrow: clone: --dissociate option to mark that reference is only temporary
Diffstat (limited to 't')
-rwxr-xr-xt/t5700-clone-reference.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh
index 6537911a43..3e783fc450 100755
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -198,4 +198,21 @@ test_expect_success 'clone using repo pointed at by gitfile as reference' '
test_cmp expected "$base_dir/O/.git/objects/info/alternates"
'
+test_expect_success 'clone and dissociate from reference' '
+ git init P &&
+ (
+ cd P && test_commit one
+ ) &&
+ git clone P Q &&
+ (
+ cd Q && test_commit two
+ ) &&
+ git clone --no-local --reference=P Q R &&
+ git clone --no-local --reference=P --dissociate Q S &&
+ # removing the reference P would corrupt R but not S
+ rm -fr P &&
+ test_must_fail git -C R fsck &&
+ git -C S fsck
+'
+
test_done