X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=tar-tree.c;h=f749d4b869ff9cf97506bc8eb3d401ec8b8ff9e3;hb=e921fb82cf6fb4a5f138ec9d27bc37c658336a8c;hp=970c4bb54e148282a89f1249a96deca880bccafd;hpb=72e5890b68e7199d92620d3bba91fa36dd259404;p=git.git diff --git a/tar-tree.c b/tar-tree.c index 970c4bb5..f749d4b8 100644 --- a/tar-tree.c +++ b/tar-tree.c @@ -34,10 +34,8 @@ struct path_prefix { static void reliable_write(void *buf, unsigned long size) { while (size > 0) { - long ret = write(1, buf, size); + long ret = xwrite(1, buf, size); if (ret < 0) { - if (errno == EAGAIN) - continue; if (errno == EPIPE) exit(0); die("git-tar-tree: %s", strerror(errno)); @@ -407,6 +405,8 @@ int main(int argc, char **argv) void *buffer; unsigned long size; + setup_git_directory(); + switch (argc) { case 3: basedir = argv[2]; @@ -433,7 +433,7 @@ int main(int argc, char **argv) archive_time = time(NULL); if (basedir) write_header((unsigned char *)"0", TYPEFLAG_DIR, NULL, NULL, - basedir, 040755, NULL, 0); + basedir, 040777, NULL, 0); traverse_tree(buffer, size, NULL); free(buffer); write_trailer();