summaryrefslogtreecommitdiff
path: root/sideband.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-02 16:27:37 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-02 16:27:37 -0700
commit265ae188267fda441f92e513fb89641f78e982fd (patch)
tree0286ec09fc86fea191aea74b0f4864ab10380253 /sideband.c
parent7240bfeaf7eccc6d2c4b2df07b7f33caa547953c (diff)
parent81f6654a47075a345ba63a394921f77fc87b6500 (diff)
downloadgit-265ae188267fda441f92e513fb89641f78e982fd.tar.gz
Merge branch 'np/progress'
* np/progress: Show total transferred as part of throughput progress make sure throughput display gets updated even if progress doesn't move return the prune-packed progress display to the inner loop add throughput display to git-push add some copyright notice to the progress display code add throughput display to index-pack add throughput to progress display relax usage of the progress API make struct progress an opaque type prune-packed: don't call display_progress() for every file Stop displaying "Pack pack-$ID created." during git-gc Teach prune-packed to use the standard progress meter Change 'Deltifying objects' to 'Compressing objects' fix for more minor memory leaks fix const issues with some functions pack-objects.c: fix some global variable abuse and memory leaks pack-objects: no delta possible with only one object in the list cope with multiple line breaks within sideband progress messages more compact progress display
Diffstat (limited to 'sideband.c')
-rw-r--r--sideband.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sideband.c b/sideband.c
index 277fa3c10d..ab8a1e990d 100644
--- a/sideband.c
+++ b/sideband.c
@@ -17,7 +17,7 @@ int recv_sideband(const char *me, int in_stream, int out, int err)
strcpy(buf, "remote:");
while (1) {
int band, len;
- len = packet_read_line(in_stream, buf+7, LARGE_PACKET_MAX);
+ len = packet_read_line(in_stream, buf+7, LARGE_PACKET_MAX);
if (len == 0)
break;
if (len < 1) {
@@ -35,7 +35,22 @@ int recv_sideband(const char *me, int in_stream, int out, int err)
return SIDEBAND_REMOTE_ERROR;
case 2:
buf[7] = ' ';
- safe_write(err, buf, 8+len);
+ len += 8;
+ while (1) {
+ int brk = 8;
+ while (brk < len) {
+ brk++;
+ if (buf[brk-1] == '\n' ||
+ buf[brk-1] == '\r')
+ break;
+ }
+ safe_write(err, buf, brk);
+ if (brk < len) {
+ memmove(buf + 8, buf + brk, len - brk);
+ len = len - brk + 8;
+ } else
+ break;
+ }
continue;
case 1:
safe_write(out, buf+8, len);