Skip to content

Commit 8cc15ac

Browse files
committed
Merge branch 'maint-1.6.2' into maint-1.6.3
* maint-1.6.2: clone: disconnect transport after fetching
2 parents d2feb01 + 12d4996 commit 8cc15ac

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

builtin-clone.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
551551
option_no_checkout = 1;
552552
}
553553

554-
if (transport)
554+
if (transport) {
555555
transport_unlock_pack(transport);
556+
transport_disconnect(transport);
557+
}
556558

557559
if (!option_no_checkout) {
558560
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));

t/t5601-clone.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ test_expect_success 'clone a void' '
149149
(
150150
cd src-0 && git init
151151
) &&
152-
git clone src-0 target-6 &&
152+
git clone "file://$(pwd)/src-0" target-6 2>err-6 &&
153+
! grep "fatal:" err-6 &&
153154
(
154155
cd src-0 && test_commit A
155156
) &&
156-
git clone src-0 target-7 &&
157+
git clone "file://$(pwd)/src-0" target-7 2>err-7 &&
158+
! grep "fatal:" err-7 &&
157159
# There is no reason to insist they are bit-for-bit
158160
# identical, but this test should suffice for now.
159161
test_cmp target-6/.git/config target-7/.git/config

0 commit comments

Comments
 (0)