summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-01-14 07:33:48 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-14 07:33:49 -0800
commit32e820bdc5ca66d53605bfdcb0751b21a2372de2 (patch)
tree3c732c0970efd3878892ba8342049ebabf6c0f6a /t
parentMerge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit' into maint (diff)
parentclone: support atomic operation with --separate-git-dir (diff)
downloadtgif-32e820bdc5ca66d53605bfdcb0751b21a2372de2.tar.xz
Merge branch 'jl/interrupt-clone-remove-separate-git-dir' into maint
When "git clone --separate-git-dir=$over_there" is interrupted, it failed to remove the real location of the $GIT_DIR it created. This was most visible when interrupting a submodule update. * jl/interrupt-clone-remove-separate-git-dir: clone: support atomic operation with --separate-git-dir
Diffstat (limited to 't')
-rwxr-xr-xt/t5600-clone-fail-cleanup.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/t5600-clone-fail-cleanup.sh b/t/t5600-clone-fail-cleanup.sh
index ee06d28649..4435693bb2 100755
--- a/t/t5600-clone-fail-cleanup.sh
+++ b/t/t5600-clone-fail-cleanup.sh
@@ -37,6 +37,16 @@ test_expect_success \
test_expect_success \
'successful clone must leave the directory' \
- 'cd bar'
+ 'test -d bar'
+
+test_expect_success 'failed clone --separate-git-dir should not leave any directories' '
+ mkdir foo/.git/objects.bak/ &&
+ mv foo/.git/objects/* foo/.git/objects.bak/ &&
+ test_must_fail git clone --separate-git-dir gitdir foo worktree &&
+ test_must_fail test -e gitdir &&
+ test_must_fail test -e worktree &&
+ mv foo/.git/objects.bak/* foo/.git/objects/ &&
+ rmdir foo/.git/objects.bak
+'
test_done