From e124ecf7f7643c83c4f23badb8e1437f863549c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Fri, 27 Aug 2021 21:59:16 +0200 Subject: archive: convert queue_directory to struct object_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass the struct object_id on instead of just its hash member. This is simpler and avoids the need to guess the algorithm. Signed-off-by: René Scharfe Acked-by: brian m. carlson Signed-off-by: Junio C Hamano --- archive.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'archive.c') diff --git a/archive.c b/archive.c index 3c266d1d7b..a3bbb09125 100644 --- a/archive.c +++ b/archive.c @@ -191,7 +191,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base, return err; } -static void queue_directory(const unsigned char *sha1, +static void queue_directory(const struct object_id *oid, struct strbuf *base, const char *filename, unsigned mode, struct archiver_context *c) { @@ -203,7 +203,7 @@ static void queue_directory(const unsigned char *sha1, d->mode = mode; c->bottom = d; d->len = xsnprintf(d->path, len, "%.*s%s/", (int)base->len, base->buf, filename); - oidread(&d->oid, sha1); + oidcpy(&d->oid, oid); } static int write_directory(struct archiver_context *c) @@ -250,8 +250,7 @@ static int queue_or_write_archive_entry(const struct object_id *oid, if (check_attr_export_ignore(check)) return 0; - queue_directory(oid->hash, base, filename, - mode, c); + queue_directory(oid, base, filename, mode, c); return READ_TREE_RECURSIVE; } -- cgit v1.2.3