mirror of
https://github.com/git/git.git
synced 2024-11-18 06:24:14 +01:00
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>
This commit is contained in:
parent
6e8e0991e5
commit
5caeeb83bc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user