Skip to content

Commit bc29df6

Browse files
committed
Merge branch 'maint-1.6.3' into maint
* maint-1.6.3: git-clone: add missing comma in --reference documentation git-cvsserver: no longer use deprecated 'git-subcommand' commands clone: disconnect transport after fetching
2 parents 82c3e21 + ba7e814 commit bc29df6

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

Documentation/git-clone.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ its source repository, you can simply run `git repack -a` to copy all
8484
objects from the source repository into a pack in the cloned repository.
8585

8686
--reference <repository>::
87-
If the reference repository is on the local machine
87+
If the reference repository is on the local machine,
8888
automatically setup .git/objects/info/alternates to
8989
obtain objects from the reference repository. Using
9090
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
@@ -574,8 +574,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
574574
option_no_checkout = 1;
575575
}
576576

577-
if (transport)
577+
if (transport) {
578578
transport_unlock_pack(transport);
579+
transport_disconnect(transport);
580+
}
579581

580582
if (!option_no_checkout) {
581583
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));

git-cvsserver.perl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ sub req_Root
285285
return 0;
286286
}
287287

288-
my @gitvars = `git-config -l`;
288+
my @gitvars = `git config -l`;
289289
if ($?) {
290290
print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n";
291291
print "E \n";
@@ -702,7 +702,7 @@ sub req_Modified
702702
# Save the file data in $state
703703
$state->{entries}{$state->{directory}.$data}{modified_filename} = $filename;
704704
$state->{entries}{$state->{directory}.$data}{modified_mode} = $mode;
705-
$state->{entries}{$state->{directory}.$data}{modified_hash} = `git-hash-object $filename`;
705+
$state->{entries}{$state->{directory}.$data}{modified_hash} = `git hash-object $filename`;
706706
$state->{entries}{$state->{directory}.$data}{modified_hash} =~ s/\s.*$//s;
707707

708708
#$log->debug("req_Modified : file=$data mode=$mode size=$size");
@@ -1289,7 +1289,7 @@ sub req_ci
12891289

12901290
# do a checkout of the file if it is part of this tree
12911291
if ($wrev) {
1292-
system('git-checkout-index', '-f', '-u', $filename);
1292+
system('git', 'checkout-index', '-f', '-u', $filename);
12931293
unless ($? == 0) {
12941294
die "Error running git-checkout-index -f -u $filename : $!";
12951295
}
@@ -1331,15 +1331,15 @@ sub req_ci
13311331
{
13321332
$log->info("Removing file '$filename'");
13331333
unlink($filename);
1334-
system("git-update-index", "--remove", $filename);
1334+
system("git", "update-index", "--remove", $filename);
13351335
}
13361336
elsif ( $addflag )
13371337
{
13381338
$log->info("Adding file '$filename'");
1339-
system("git-update-index", "--add", $filename);
1339+
system("git", "update-index", "--add", $filename);
13401340
} else {
13411341
$log->info("Updating file '$filename'");
1342-
system("git-update-index", $filename);
1342+
system("git", "update-index", $filename);
13431343
}
13441344
}
13451345

@@ -1351,7 +1351,7 @@ sub req_ci
13511351
return;
13521352
}
13531353

1354-
my $treehash = `git-write-tree`;
1354+
my $treehash = `git write-tree`;
13551355
chomp $treehash;
13561356

13571357
$log->debug("Treehash : $treehash, Parenthash : $parenthash");
@@ -1368,7 +1368,7 @@ sub req_ci
13681368
}
13691369
close $msg_fh;
13701370

1371-
my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;
1371+
my $commithash = `git commit-tree $treehash -p $parenthash < $msg_filename`;
13721372
chomp($commithash);
13731373
$log->info("Commit hash : $commithash");
13741374

@@ -1821,7 +1821,7 @@ sub req_annotate
18211821
# TODO: if we got a revision from the client, use that instead
18221822
# to look up the commithash in sqlite (still good to default to
18231823
# the current head as we do now)
1824-
system("git-read-tree", $lastseenin);
1824+
system("git", "read-tree", $lastseenin);
18251825
unless ($? == 0)
18261826
{
18271827
print "E error running git-read-tree $lastseenin $ENV{GIT_INDEX_FILE} $!\n";
@@ -1830,7 +1830,7 @@ sub req_annotate
18301830
$log->info("Created index '$ENV{GIT_INDEX_FILE}' with commit $lastseenin - exit status $?");
18311831

18321832
# do a checkout of the file
1833-
system('git-checkout-index', '-f', '-u', $filename);
1833+
system('git', 'checkout-index', '-f', '-u', $filename);
18341834
unless ($? == 0) {
18351835
print "E error running git-checkout-index -f -u $filename : $!\n";
18361836
return;
@@ -1861,7 +1861,7 @@ sub req_annotate
18611861
close ANNOTATEHINTS
18621862
or (print "E failed to write $a_hints: $!\n"), return;
18631863

1864-
my @cmd = (qw(git-annotate -l -S), $a_hints, $filename);
1864+
my @cmd = (qw(git annotate -l -S), $a_hints, $filename);
18651865
if (!open(ANNOTATE, "-|", @cmd)) {
18661866
print "E error invoking ". join(' ',@cmd) .": $!\n";
18671867
return;
@@ -2078,17 +2078,17 @@ sub transmitfile
20782078

20792079
die "Need filehash" unless ( defined ( $filehash ) and $filehash =~ /^[a-zA-Z0-9]{40}$/ );
20802080

2081-
my $type = `git-cat-file -t $filehash`;
2081+
my $type = `git cat-file -t $filehash`;
20822082
chomp $type;
20832083

20842084
die ( "Invalid type '$type' (expected 'blob')" ) unless ( defined ( $type ) and $type eq "blob" );
20852085

2086-
my $size = `git-cat-file -s $filehash`;
2086+
my $size = `git cat-file -s $filehash`;
20872087
chomp $size;
20882088

20892089
$log->debug("transmitfile($filehash) size=$size, type=$type");
20902090

2091-
if ( open my $fh, '-|', "git-cat-file", "blob", $filehash )
2091+
if ( open my $fh, '-|', "git", "cat-file", "blob", $filehash )
20922092
{
20932093
if ( defined ( $options->{targetfile} ) )
20942094
{
@@ -2935,7 +2935,7 @@ sub update
29352935
push @git_log_params, $self->{module};
29362936
}
29372937
# git-rev-list is the backend / plumbing version of git-log
2938-
open(GITLOG, '-|', 'git-rev-list', @git_log_params) or die "Cannot call git-rev-list: $!";
2938+
open(GITLOG, '-|', 'git', 'rev-list', @git_log_params) or die "Cannot call git-rev-list: $!";
29392939

29402940
my @commits;
29412941

@@ -3021,7 +3021,7 @@ sub update
30213021
next;
30223022
}
30233023
my $base = eval {
3024-
safe_pipe_capture('git-merge-base',
3024+
safe_pipe_capture('git', 'merge-base',
30253025
$lastpicked, $parent);
30263026
};
30273027
# The two branches may not be related at all,
@@ -3033,7 +3033,7 @@ sub update
30333033
if ($base) {
30343034
my @merged;
30353035
# print "want to log between $base $parent \n";
3036-
open(GITLOG, '-|', 'git-log', '--pretty=medium', "$base..$parent")
3036+
open(GITLOG, '-|', 'git', 'log', '--pretty=medium', "$base..$parent")
30373037
or die "Cannot call git-log: $!";
30383038
my $mergedhash;
30393039
while (<GITLOG>) {
@@ -3075,7 +3075,7 @@ sub update
30753075

30763076
if ( defined ( $lastpicked ) )
30773077
{
3078-
my $filepipe = open(FILELIST, '-|', 'git-diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
3078+
my $filepipe = open(FILELIST, '-|', 'git', 'diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
30793079
local ($/) = "\0";
30803080
while ( <FILELIST> )
30813081
{
@@ -3149,7 +3149,7 @@ sub update
31493149
# this is used to detect files removed from the repo
31503150
my $seen_files = {};
31513151

3152-
my $filepipe = open(FILELIST, '-|', 'git-ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
3152+
my $filepipe = open(FILELIST, '-|', 'git', 'ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
31533153
local $/ = "\0";
31543154
while ( <FILELIST> )
31553155
{
@@ -3451,7 +3451,7 @@ sub commitmessage
34513451
return $message;
34523452
}
34533453

3454-
my @lines = safe_pipe_capture("git-cat-file", "commit", $commithash);
3454+
my @lines = safe_pipe_capture("git", "cat-file", "commit", $commithash);
34553455
shift @lines while ( $lines[0] =~ /\S/ );
34563456
$message = join("",@lines);
34573457
$message .= " " if ( $message =~ /\n$/ );

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)