Skip to content

Commit 6207391

Browse files
committed
Merge branch 'ready-for-upstream'
This is the branch thicket of patches in Git for Windows that are considered ready for upstream. To keep them in a ready-to-submit shape, they are kept as close to the beginning of the branch thicket as possible.
2 parents d2b083f + 04e1b87 commit 6207391

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+859
-101
lines changed

Documentation/config.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ include::config/reset.txt[]
438438

439439
include::config/sendemail.txt[]
440440

441+
include::config/sendpack.txt[]
442+
441443
include::config/sequencer.txt[]
442444

443445
include::config/showbranch.txt[]

Documentation/config/http.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,13 @@ http.sslBackend::
173173

174174
http.schannelCheckRevoke::
175175
Used to enforce or disable certificate revocation checks in cURL
176-
when http.sslBackend is set to "schannel". Defaults to `true` if
177-
unset. Only necessary to disable this if Git consistently errors
178-
and the message is about checking the revocation status of a
179-
certificate. This option is ignored if cURL lacks support for
180-
setting the relevant SSL option at runtime.
176+
when http.sslBackend is set to "schannel" via "true" and "false",
177+
respectively. Another accepted value is "best-effort" (the default)
178+
in which case revocation checks are performed, but errors due to
179+
revocation list distribution points that are offline are silently
180+
ignored, as well as errors due to certificates missing revocation
181+
list distribution points. This option is ignored if cURL lacks
182+
support for setting the relevant SSL option at runtime.
181183

182184
http.schannelUseSSLCAInfo::
183185
As of cURL v7.60.0, the Secure Channel backend can use the

Documentation/config/sendpack.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sendpack.sideband::
2+
Allows to disable the side-band-64k capability for send-pack even
3+
when it is advertised by the server. Makes it possible to work
4+
around a limitation in the git for windows implementation together
5+
with the dump git protocol. Defaults to true.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,6 +2767,11 @@ ifdef GIT_INTEROP_MAKE_OPTS
27672767
endif
27682768
ifdef GIT_TEST_INDEX_VERSION
27692769
@echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
2770+
endif
2771+
ifdef RUNTIME_PREFIX
2772+
@echo RUNTIME_PREFIX=\'true\' >>$@+
2773+
else
2774+
@echo RUNTIME_PREFIX=\'false\' >>$@+
27702775
endif
27712776
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
27722777

abspath.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ char *strbuf_realpath(struct strbuf *resolved, const char *path,
9595
goto error_out;
9696
}
9797

98+
if (platform_strbuf_realpath(resolved, path))
99+
return resolved->buf;
100+
98101
strbuf_addstr(&remaining, path);
99102
get_root_part(resolved, &remaining);
100103

archive-tar.c

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ static unsigned long offset;
1717

1818
static int tar_umask = 002;
1919

20+
static gzFile gzip;
21+
2022
static int write_tar_filter_archive(const struct archiver *ar,
2123
struct archiver_args *args);
2224

@@ -38,11 +40,21 @@ static int write_tar_filter_archive(const struct archiver *ar,
3840
#define USTAR_MAX_MTIME 077777777777ULL
3941
#endif
4042

43+
/* writes out the whole block, or dies if fails */
44+
static void write_block_or_die(const char *block) {
45+
if (gzip) {
46+
if (gzwrite(gzip, block, (unsigned) BLOCKSIZE) != BLOCKSIZE)
47+
die(_("gzwrite failed"));
48+
} else {
49+
write_or_die(1, block, BLOCKSIZE);
50+
}
51+
}
52+
4153
/* writes out the whole block, but only if it is full */
4254
static void write_if_needed(void)
4355
{
4456
if (offset == BLOCKSIZE) {
45-
write_or_die(1, block, BLOCKSIZE);
57+
write_block_or_die(block);
4658
offset = 0;
4759
}
4860
}
@@ -66,7 +78,7 @@ static void do_write_blocked(const void *data, unsigned long size)
6678
write_if_needed();
6779
}
6880
while (size >= BLOCKSIZE) {
69-
write_or_die(1, buf, BLOCKSIZE);
81+
write_block_or_die(buf);
7082
size -= BLOCKSIZE;
7183
buf += BLOCKSIZE;
7284
}
@@ -101,10 +113,10 @@ static void write_trailer(void)
101113
{
102114
int tail = BLOCKSIZE - offset;
103115
memset(block + offset, 0, tail);
104-
write_or_die(1, block, BLOCKSIZE);
116+
write_block_or_die(block);
105117
if (tail < 2 * RECORDSIZE) {
106118
memset(block, 0, offset);
107-
write_or_die(1, block, BLOCKSIZE);
119+
write_block_or_die(block);
108120
}
109121
}
110122

@@ -445,18 +457,34 @@ static int write_tar_filter_archive(const struct archiver *ar,
445457
filter.use_shell = 1;
446458
filter.in = -1;
447459

448-
if (start_command(&filter) < 0)
449-
die_errno(_("unable to start '%s' filter"), argv[0]);
450-
close(1);
451-
if (dup2(filter.in, 1) < 0)
452-
die_errno(_("unable to redirect descriptor"));
453-
close(filter.in);
460+
if (!strcmp("gzip -cn", ar->data)) {
461+
char outmode[4] = "wb\0";
462+
463+
if (args->compression_level >= 0 && args->compression_level <= 9)
464+
outmode[2] = '0' + args->compression_level;
465+
466+
gzip = gzdopen(fileno(stdout), outmode);
467+
if (!gzip)
468+
die(_("Could not gzdopen stdout"));
469+
} else {
470+
if (start_command(&filter) < 0)
471+
die_errno(_("unable to start '%s' filter"), argv[0]);
472+
close(1);
473+
if (dup2(filter.in, 1) < 0)
474+
die_errno(_("unable to redirect descriptor"));
475+
close(filter.in);
476+
}
454477

455478
r = write_tar_archive(ar, args);
456479

457-
close(1);
458-
if (finish_command(&filter) != 0)
459-
die(_("'%s' filter reported error"), argv[0]);
480+
if (gzip) {
481+
if (gzclose(gzip) != Z_OK)
482+
die(_("gzclose failed"));
483+
} else {
484+
close(1);
485+
if (finish_command(&filter) != 0)
486+
die(_("'%s' filter reported error"), argv[0]);
487+
}
460488

461489
strbuf_release(&cmd);
462490
return r;

builtin/clean.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ static const char *msg_remove = N_("Removing %s\n");
3434
static const char *msg_would_remove = N_("Would remove %s\n");
3535
static const char *msg_skip_git_dir = N_("Skipping repository %s\n");
3636
static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n");
37+
#ifndef CAN_UNLINK_MOUNT_POINTS
38+
static const char *msg_skip_mount_point = N_("Skipping mount point %s\n");
39+
static const char *msg_would_skip_mount_point = N_("Would skip mount point %s\n");
40+
#endif
3741
static const char *msg_warn_remove_failed = N_("failed to remove %s");
3842
static const char *msg_warn_lstat_failed = N_("could not lstat %s\n");
3943

@@ -171,6 +175,29 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
171175
goto out;
172176
}
173177

178+
if (is_mount_point(path)) {
179+
#ifndef CAN_UNLINK_MOUNT_POINTS
180+
if (!quiet) {
181+
quote_path(path->buf, prefix, &quoted, 0);
182+
printf(dry_run ?
183+
_(msg_would_skip_mount_point) :
184+
_(msg_skip_mount_point), quoted.buf);
185+
}
186+
*dir_gone = 0;
187+
#else
188+
if (!dry_run && unlink(path->buf)) {
189+
int saved_errno = errno;
190+
quote_path(path->buf, prefix, &quoted, 0);
191+
errno = saved_errno;
192+
warning_errno(_(msg_warn_remove_failed), quoted.buf);
193+
*dir_gone = 0;
194+
ret = -1;
195+
}
196+
#endif
197+
198+
goto out;
199+
}
200+
174201
dir = opendir(path->buf);
175202
if (!dir) {
176203
/* an empty dir could be removed even if it is unreadble */

builtin/clone.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
12541254
}
12551255

12561256
if (!is_local && !complete_refs_before_fetch)
1257-
transport_fetch_refs(transport, mapped_refs);
1257+
if (transport_fetch_refs(transport, mapped_refs))
1258+
die(_("could not fetch refs from %s"),
1259+
transport->url);
12581260

12591261
remote_head = find_ref_by_name(refs, "HEAD");
12601262
remote_head_points_at =

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,7 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
13291329
int normalize_path_copy(char *dst, const char *src);
13301330
int longest_ancestor_length(const char *path, struct string_list *prefixes);
13311331
char *strip_path_suffix(const char *path, const char *suffix);
1332+
int is_mount_point_via_stat(struct strbuf *path);
13321333
int daemon_avoid_alias(const char *path);
13331334

13341335
/*

0 commit comments

Comments
 (0)