Skip to content

Commit ba7e814

Browse files
committed
Merge branch 'maint-1.6.2' into maint-1.6.3
* maint-1.6.2: git-clone: add missing comma in --reference documentation clone: disconnect transport after fetching
2 parents d2feb01 + 4059237 commit ba7e814

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Documentation/git-clone.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ then the cloned repository will become corrupt.
7676

7777

7878
--reference <repository>::
79-
If the reference repository is on the local machine
79+
If the reference repository is on the local machine,
8080
automatically setup .git/objects/info/alternates to
8181
obtain objects from the reference repository. Using
8282
an already existing repository as an alternate will

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)