aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2009-06-16 20:41:16 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-18 11:38:43 -0700
commit9462e3f59cd5a545330a9490a27d68b79f1d0ce7 (patch)
tree1a19becaac1e84f0a88428976fca0408777ef04f
parent5d87dd4fcac808fc0f0b993b470644ba7d2d62a2 (diff)
downloadgit-9462e3f59cd5a545330a9490a27d68b79f1d0ce7.tar.gz
git-9462e3f59cd5a545330a9490a27d68b79f1d0ce7.tar.xz
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--upload-pack.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/upload-pack.c b/upload-pack.c
index edc786122..841ebb534 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -28,7 +28,7 @@ static unsigned long oldest_have;
static int multi_ack, nr_our_refs;
static int use_thin_pack, use_ofs_delta, use_include_tag;
-static int no_progress;
+static int no_progress, daemon_mode;
static struct object_array have_obj;
static struct object_array want_obj;
static unsigned int timeout;
@@ -521,6 +521,10 @@ static void receive_needs(void)
}
if (debug_fd)
write_in_full(debug_fd, "#E\n", 3);
+
+ if (!use_sideband && daemon_mode)
+ no_progress = 1;
+
if (depth == 0 && shallows.nr == 0)
return;
if (depth > 0) {
@@ -630,6 +634,7 @@ int main(int argc, char **argv)
}
if (!prefixcmp(arg, "--timeout=")) {
timeout = atoi(arg+10);
+ daemon_mode = 1;
continue;
}
if (!strcmp(arg, "--")) {