summaryrefslogtreecommitdiff
path: root/archive-tar.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:05:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:39 (GMT)
commitbbf05cf70e5d0ba113ea4ed4c7c77cb890707911 (patch)
tree385cde5377863205a589bf0bbf71cd06727a826b /archive-tar.c
parent87003d2c94985f9b3c5ef23b9c042ae3b4ede6bb (diff)
downloadgit-bbf05cf70e5d0ba113ea4ed4c7c77cb890707911.zip
git-bbf05cf70e5d0ba113ea4ed4c7c77cb890707911.tar.gz
git-bbf05cf70e5d0ba113ea4ed4c7c77cb890707911.tar.bz2
archive: convert struct archiver_args to object_id
Change the commit_sha1 member to be called "commit_oid" and change it to be a pointer to struct object_id. Additionally, update some uses of GIT_SHA1_HEXSZ and hard-coded values to use the_hash_algo instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 4aabd56..3e53aac 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -326,14 +326,15 @@ static int write_tar_entry(struct archiver_args *args,
static void write_global_extended_header(struct archiver_args *args)
{
- const unsigned char *sha1 = args->commit_sha1;
+ const struct object_id *oid = args->commit_oid;
struct strbuf ext_header = STRBUF_INIT;
struct ustar_header header;
unsigned int mode;
- if (sha1)
+ if (oid)
strbuf_append_ext_header(&ext_header, "comment",
- sha1_to_hex(sha1), 40);
+ oid_to_hex(oid),
+ the_hash_algo->hexsz);
if (args->time > USTAR_MAX_MTIME) {
strbuf_append_ext_header_uint(&ext_header, "mtime",
args->time);