Skip to content

Commit bdc552b

Browse files
committed
fixup! clone --dissociate: avoid locking pack files
1 parent 453e7a8 commit bdc552b

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

builtin/clone.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,15 +1066,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
10661066
transport_unlock_pack(transport);
10671067
transport_disconnect(transport);
10681068

1069-
if (option_dissociate) {
1070-
struct packed_git *p;
1071-
1072-
for (p = packed_git; p; p = p->next) {
1073-
close_pack_windows(p);
1074-
close_pack_index(p);
1075-
}
1069+
if (option_dissociate)
10761070
dissociate_from_references();
1077-
}
10781071

10791072
junk_mode = JUNK_LEAVE_REPO;
10801073
err = checkout();

t/t5700-clone-reference.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,5 @@ 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_success '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-
'
212191

213192
test_done

0 commit comments

Comments
 (0)