X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=upload-pack.c;h=3648aae1a777aec4bba77b40b9cf6da484190441;hb=fd2a75972e90d34bc8d4bebe1d669645557a2192;hp=c568ef066c9e7e0021468cfe7cb904f40ac477f1;hpb=b11bd57a384a7bee21245d3895d77d20c33e4d78;p=git.git diff --git a/upload-pack.c b/upload-pack.c index c568ef066..3648aae1a 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -55,6 +55,7 @@ static ssize_t send_client_data(int fd, const char *data, ssize_t sz) /* emergency quit */ fd = 2; if (fd == 2) { + /* XXX: are we happy to lose stuff here? */ xwrite(fd, data, sz); return sz; } @@ -242,7 +243,7 @@ static void create_pack_file(void) *cp++ = buffered; outsz++; } - sz = read(pu_pipe[0], cp, + sz = xread(pu_pipe[0], cp, sizeof(data) - outsz); if (0 < sz) ; @@ -267,7 +268,7 @@ static void create_pack_file(void) /* Status ready; we ship that in the side-band * or dump to the standard error. */ - sz = read(pe_pipe[0], progress, + sz = xread(pe_pipe[0], progress, sizeof(progress)); if (0 < sz) send_client_data(2, progress, sz); @@ -671,7 +672,8 @@ int main(int argc, char **argv) if (!enter_repo(dir, strict)) die("'%s': unable to chdir or not a git archive", dir); - + if (is_repository_shallow()) + die("attempt to fetch/clone from a shallow repository"); upload_pack(); return 0; }