diff options
author | Jeff King <peff@peff.net> | 2016-06-30 05:09:26 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-01 10:26:28 -0700 |
commit | 5caeeb83bcb88622db739fe27ee8bfc64e9cbf21 (patch) | |
tree | dd544c46ce74b68c11e3357371eb358db180e6b0 | |
parent | 6e8e0991e5219954f049731d18e5f53c5f5f526b (diff) | |
download | git-5caeeb83bcb88622db739fe27ee8bfc64e9cbf21.tar.gz |
archive-tar: drop return value
We never do any error checks, and so never return anything
but "0". Let's just drop this to simplify the code.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | archive-tar.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/archive-tar.c b/archive-tar.c index d671bc34f2..7ea4e90814 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -319,13 +319,12 @@ static int write_tar_entry(struct archiver_args *args, return err; } -static int write_global_extended_header(struct archiver_args *args) +static void write_global_extended_header(struct archiver_args *args) { const unsigned char *sha1 = args->commit_sha1; struct strbuf ext_header = STRBUF_INIT; struct ustar_header header; unsigned int mode; - int err = 0; if (sha1) strbuf_append_ext_header(&ext_header, "comment", @@ -337,7 +336,7 @@ static int write_global_extended_header(struct archiver_args *args) } if (!ext_header.len) - return 0; + return; memset(&header, 0, sizeof(header)); *header.typeflag = TYPEFLAG_GLOBAL_HEADER; @@ -347,7 +346,6 @@ static int write_global_extended_header(struct archiver_args *args) write_blocked(&header, sizeof(header)); write_blocked(ext_header.buf, ext_header.len); strbuf_release(&ext_header); - return err; } static struct archiver **tar_filters; @@ -423,9 +421,8 @@ static int write_tar_archive(const struct archiver *ar, { int err = 0; - err = write_global_extended_header(args); - if (!err) - err = write_archive_entries(args, write_tar_entry); + write_global_extended_header(args); + err = write_archive_entries(args, write_tar_entry); if (!err) write_trailer(); return err; |