{"thread":{"id":"56389","subject":"[PATCH] archive: convert queue_directory to struct object_id","startedAt":"2021-08-27T19:59:22Z","lastAt":"2021-08-27T21:19:09Z","messageCount":3,"participants":["René Scharfe","brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"433952","messageId":"bfdb36fc-3b92-fe62-e928-dc235cede31d@web.de","threadId":"56389","inReplyTo":null,"subject":"[PATCH] archive: convert queue_directory to struct object_id","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2021-08-27T19:59:16Z","receivedAt":"2021-08-27T19:59:22Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Pass the struct object_id on instead of just its hash member.\nThis is simpler and avoids the need to guess the algorithm.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n archive.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/archive.c b/archive.c\nindex 3c266d1d7b..a3bbb09125 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -191,7 +191,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,\n \treturn err;\n }\n\n-static void queue_directory(const unsigned char *sha1,\n+static void queue_directory(const struct object_id *oid,\n \t\tstruct strbuf *base, const char *filename,\n \t\tunsigned mode, struct archiver_context *c)\n {\n@@ -203,7 +203,7 @@ static void queue_directory(const unsigned char *sha1,\n \td->mode\t   = mode;\n \tc->bottom  = d;\n \td->len = xsnprintf(d->path, len, \"%.*s%s/\", (int)base->len, base->buf, filename);\n-\toidread(&d->oid, sha1);\n+\toidcpy(&d->oid, oid);\n }\n\n static int write_directory(struct archiver_context *c)\n@@ -250,8 +250,7 @@ static int queue_or_write_archive_entry(const struct object_id *oid,\n\n \t\tif (check_attr_export_ignore(check))\n \t\t\treturn 0;\n-\t\tqueue_directory(oid->hash, base, filename,\n-\t\t\t\tmode, c);\n+\t\tqueue_directory(oid, base, filename, mode, c);\n \t\treturn READ_TREE_RECURSIVE;\n \t}\n\n--\n2.33.0\n"},{"id":"433953","messageId":"YSlN0+ZCpDqoem9J@camp.crustytoothpaste.net","threadId":"56389","inReplyTo":"bfdb36fc-3b92-fe62-e928-dc235cede31d@web.de","subject":"Re: [PATCH] archive: convert queue_directory to struct object_id","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-08-27T20:40:51Z","receivedAt":"2021-08-27T20:40:59Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-08-27 at 19:59:16, René Scharfe wrote:\n> Pass the struct object_id on instead of just its hash member.\n> This is simpler and avoids the need to guess the algorithm.\n\nSeems reasonable.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"433965","messageId":"xmqqk0k6a8n7.fsf@gitster.g","threadId":"56389","inReplyTo":"YSlN0+ZCpDqoem9J@camp.crustytoothpaste.net","subject":"Re: [PATCH] archive: convert queue_directory to struct object_id","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-27T21:18:52Z","receivedAt":"2021-08-27T21:19:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2021-08-27 at 19:59:16, René Scharfe wrote:\n>> Pass the struct object_id on instead of just its hash member.\n>> This is simpler and avoids the need to guess the algorithm.\n>\n> Seems reasonable.\n\nI guess this is about the oidread() you added at the end of the\nfunction, so I'd take the above as your Acked-by ;-)\n\nThanks, both.  Will queue.\n\n"}]}