Skip to content

Commit dddce2f

Browse files
committed
Demonstrate a Windows file locking issue with git clone --dissociate
On Windows, dissociating from a reference can fail very easily due to pack files that are still in use when they want to be removed. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 9743c9f commit dddce2f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t5700-clone-reference.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,26 @@ test_expect_success 'clone and dissociate from reference' '
188188
test_must_fail git -C R fsck &&
189189
git -C S fsck
190190
'
191+
test_expect_failure MINGW 'clone, dissociate from partial reference and repack' '
192+
rm -fr P Q R &&
193+
git init P &&
194+
(
195+
cd P &&
196+
test_commit one &&
197+
git repack &&
198+
test_commit two &&
199+
git repack
200+
) &&
201+
git clone --bare P Q &&
202+
(
203+
cd P &&
204+
git checkout -b second &&
205+
test_commit three &&
206+
git repack
207+
) &&
208+
git clone --bare --dissociate --reference=P Q R &&
209+
ls R/objects/pack/*.pack >packs.txt &&
210+
test_line_count = 1 packs.txt
211+
'
191212

192213
test_done

0 commit comments

Comments
 (0)