Skip to content

Commit 1259404

Browse files
author
Junio C Hamano
committed
Merge branch 'maint'
* maint: gitweb: Fix setting $/ in parse_commit() daemon: do not die on older clients. xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header. git-clone: honor --quiet Documentation for the [remote] config prune-packed: Fix uninitialized variable.
2 parents b4aee09 + a153adf commit 1259404

File tree

7 files changed

+30
-6
lines changed

7 files changed

+30
-6
lines changed

Documentation/config.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ pull.octopus::
230230
pull.twohead::
231231
The default merge strategy to use when pulling a single branch.
232232

233+
remote.<name>.url::
234+
The URL of a remote repository. See gitlink:git-fetch[1] or
235+
gitlink:git-push[1].
236+
237+
remote.<name>.fetch::
238+
The default set of "refspec" for gitlink:git-fetch[1]. See
239+
gitlink:git-fetch[1].
240+
241+
remote.<name>.push::
242+
The default set of "refspec" for gitlink:git-push[1]. See
243+
gitlink:git-push[1].
244+
233245
repack.usedeltabaseoffset::
234246
Allow gitlink:git-repack[1] to create packs that uses
235247
delta-base offset. Defaults to false.

Documentation/urls.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ lines are used for `git-push` and `git-fetch`/`git-pull`,
5151
respectively. Multiple `Push:` and `Pull:` lines may
5252
be specified for additional branch mappings.
5353

54+
Or, equivalently, in the `$GIT_DIR/config` (note the use
55+
of `fetch` instead of `Pull:`):
56+
57+
[remote "<remote>"]
58+
url = <url>
59+
push = <refspec>
60+
fetch = <refspec>
61+
5462
The name of a file in `$GIT_DIR/branches` directory can be
5563
specified as an older notation short-hand; the named
5664
file should contain a single line, a URL in one of the

builtin-prune-packed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void prune_packed_objects(int dryrun)
5656
int cmd_prune_packed(int argc, const char **argv, const char *prefix)
5757
{
5858
int i;
59-
int dryrun;
59+
int dryrun = 0;
6060

6161
for (i = 1; i < argc; i++) {
6262
const char *arg = argv[i];

daemon.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ void fill_in_extra_table_entries(struct interp *itable)
450450
* Replace literal host with lowercase-ized hostname.
451451
*/
452452
hp = interp_table[INTERP_SLOT_HOST].value;
453+
if (!hp)
454+
return;
453455
for ( ; *hp; hp++)
454456
*hp = tolower(*hp);
455457

@@ -544,8 +546,10 @@ static int execute(struct sockaddr *addr)
544546
loginfo("Extended attributes (%d bytes) exist <%.*s>",
545547
(int) pktlen - len,
546548
(int) pktlen - len, line + len + 1);
547-
if (len && line[len-1] == '\n')
549+
if (len && line[len-1] == '\n') {
548550
line[--len] = 0;
551+
pktlen--;
552+
}
549553

550554
/*
551555
* Initialize the path interpolation table for this connection.

git-clone.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ Pull: refs/heads/$head_points_at:$origin_track" &&
401401

402402
case "$no_checkout" in
403403
'')
404-
git-read-tree -m -u -v HEAD HEAD
404+
test "z$quiet" = z && v=-v || v=
405+
git-read-tree -m -u $v HEAD HEAD
405406
esac
406407
fi
407408
rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD"

gitweb/gitweb.perl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,12 +1059,11 @@ sub parse_commit {
10591059
if (defined $commit_text) {
10601060
@commit_lines = @$commit_text;
10611061
} else {
1062-
$/ = "\0";
1062+
local $/ = "\0";
10631063
open my $fd, "-|", git_cmd(), "rev-list", "--header", "--parents", "--max-count=1", $commit_id
10641064
or return;
10651065
@commit_lines = split '\n', <$fd>;
10661066
close $fd or return;
1067-
$/ = "\n";
10681067
pop @commit_lines;
10691068
}
10701069
my $header = shift @commit_lines;

xdiff/xemit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
9090
*rec == '#')) { /* #define? */
9191
if (len > sz)
9292
len = sz;
93-
if (len && rec[len - 1] == '\n')
93+
while (0 < len && isspace((unsigned char)rec[len - 1]))
9494
len--;
9595
memcpy(buf, rec, len);
9696
*ll = len;

0 commit comments

Comments
 (0)