Browse Source

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>
maint
Jeff King 9 years ago committed by Junio C Hamano
parent
commit
5caeeb83bc
  1. 11
      archive-tar.c

11
archive-tar.c

@ -319,13 +319,12 @@ static int write_tar_entry(struct archiver_args *args, @@ -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) @@ -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) @@ -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, @@ -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;

Loading…
Cancel
Save