From: Junio C Hamano Date: Tue, 4 Apr 2006 06:43:16 +0000 (-0700) Subject: Merge branch 'lt/fix-sol-pack' into next X-Git-Tag: v1.3.0-rc4~47 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7941602983f68e2cddafca5a2da8215d1271742b;p=git.git Merge branch 'lt/fix-sol-pack' into next * lt/fix-sol-pack: Use sigaction and SA_RESTART in read-tree.c; add option in Makefile. safe_fgets() - even more anal fgets() --- 7941602983f68e2cddafca5a2da8215d1271742b diff --cc pack-objects.c index 0ea16ad67,7d6247791..d7ba938af --- a/pack-objects.c +++ b/pack-objects.c @@@ -1118,17 -915,15 +1118,18 @@@ int main(int argc, char **argv break; if (!ferror(stdin)) die("fgets returned NULL, not EOF, not error!"); - if (errno == EINTR) - continue; - die("fgets: %s", strerror(errno)); + if (errno != EINTR) + die("fgets: %s", strerror(errno)); + clearerr(stdin); + continue; } - if (progress_update) { - fprintf(stderr, "Counting objects...%d\r", nr_objects); - progress_update = 0; + if (line[0] == '-') { + if (get_sha1_hex(line+1, sha1)) + die("expected edge sha1, got garbage:\n %s", + line+1); + add_preferred_base(sha1); + continue; } if (get_sha1_hex(line, sha1)) die("expected sha1, got garbage:\n %s", line);