Skip to content

Commit 9462e3f

Browse files
j6tgitster
authored andcommitted
upload-pack: squelch progress indicator if client cannot see it
upload-pack runs pack-objects, which generates progress indicator output on its stderr. If the client requests a sideband, this indicator is sent to the client; but if it did not, then the progress is written to upload-pack's own stderr. If upload-pack is itself run from git-daemon (and if the client did not request a sideband) the progress indicator never reaches the client and it need not be generated in the first place. With this patch the progress indicator is suppressed in this situation. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5d87dd4 commit 9462e3f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

upload-pack.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static unsigned long oldest_have;
2828

2929
static int multi_ack, nr_our_refs;
3030
static int use_thin_pack, use_ofs_delta, use_include_tag;
31-
static int no_progress;
31+
static int no_progress, daemon_mode;
3232
static struct object_array have_obj;
3333
static struct object_array want_obj;
3434
static unsigned int timeout;
@@ -521,6 +521,10 @@ static void receive_needs(void)
521521
}
522522
if (debug_fd)
523523
write_in_full(debug_fd, "#E\n", 3);
524+
525+
if (!use_sideband && daemon_mode)
526+
no_progress = 1;
527+
524528
if (depth == 0 && shallows.nr == 0)
525529
return;
526530
if (depth > 0) {
@@ -630,6 +634,7 @@ int main(int argc, char **argv)
630634
}
631635
if (!prefixcmp(arg, "--timeout=")) {
632636
timeout = atoi(arg+10);
637+
daemon_mode = 1;
633638
continue;
634639
}
635640
if (!strcmp(arg, "--")) {

0 commit comments

Comments
 (0)