Author: Christian Hesse <mail@eworm.de>
ui-blog: fix oid handling We have to use a pointer for walk_tree_ctx->matched_oid. This fixes faulty commit 6e4b7b6776eb994e795fa38b2619db6c55e10ecc (ui-blob: replace 'unsigned char sha1[20]' with 'struct object_id oid').
ui-blob.c | 10 +++++-----
diff --git a/ui-blob.c b/ui-blob.c index 2f8bb7a006fc82ffe6f827f46bb3793e7d99e1fa..5f30de753737290c1f3e3f4c6a4a861609d907a7 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -13,7 +13,7 @@ #include "ui-shared.h" struct walk_tree_context { const char *match_path; - struct object_id matched_oid; + struct object_id *matched_oid; unsigned int found_path:1; unsigned int file_only:1; }; @@ -28,7 +28,7 @@ return READ_TREE_RECURSIVE; if (strncmp(base->buf, walk_tree_ctx->match_path, base->len) || strcmp(walk_tree_ctx->match_path + base->len, pathname)) return READ_TREE_RECURSIVE; - hashcpy(walk_tree_ctx->matched_oid.hash, sha1); + hashcpy(walk_tree_ctx->matched_oid->hash, sha1); walk_tree_ctx->found_path = 1; return 0; } @@ -47,7 +47,7 @@ .items = &path_items }; struct walk_tree_context walk_tree_ctx = { .match_path = path, - .matched_oid = oid, + .matched_oid = &oid, .found_path = 0, .file_only = file_only }; @@ -77,7 +77,7 @@ .items = &path_items }; struct walk_tree_context walk_tree_ctx = { .match_path = path, - .matched_oid = oid, + .matched_oid = &oid, .found_path = 0, .file_only = file_only }; @@ -120,7 +120,7 @@ .items = &path_items }; struct walk_tree_context walk_tree_ctx = { .match_path = path, - .matched_oid = oid, + .matched_oid = &oid, .found_path = 0, .file_only = file_only };