aboutsummaryrefslogtreecommitdiffstats
path: root/ui-blame.c
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-11-02 15:21:58 +0000
committersaturneric <[email protected]>2025-11-02 15:21:58 +0000
commit960134bef2cd769981cad8df0bd63cb0461e6bbe (patch)
tree6118799a8eb7ceb1efcff4e2c0be3dd21b2f4e4f /ui-blame.c
parentchore(submodule): update `git` submodule URL and commit (diff)
downloadcgit-960134bef2cd769981cad8df0bd63cb0461e6bbe.tar.gz
cgit-960134bef2cd769981cad8df0bd63cb0461e6bbe.zip
refactor(repo): migrate to new object database API
* Replace legacy object store interfaces with new `odb` API * Update function signatures to include referent param for callbacks * Use improved object lookup and read methods for consistency * Simplify file path handling with repository-scoped utilities Modernizes repository object access for better maintainability and future compatibility. No functional regressions expected.
Diffstat (limited to 'ui-blame.c')
-rw-r--r--ui-blame.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui-blame.c b/ui-blame.c
index d07b67f..f282904 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -121,15 +121,15 @@ static void print_object(const struct object_id *oid, const char *path,
struct blame_origin *o;
struct blame_entry *ent = NULL;
- type = oid_object_info(the_repository, oid, &size);
- if (type == OBJ_BAD) {
- cgit_print_error_page(404, "Not found", "Bad object name: %s",
- oid_to_hex(oid));
+ if (!odb_has_object(the_repository->objects, oid, 0)) {
+ cgit_print_error_page(404, "Not found",
+ "Object %s not found in repository",
+ oid_to_hex(oid));
return;
}
- buf = repo_read_object_file(the_repository, oid, &type, &size);
- if (!buf) {
+ buf = odb_read_object(the_repository->objects, oid, &type, &size);
+ if (!buf || type != OBJ_BLOB) {
cgit_print_error_page(500, "Internal server error",
"Error reading object %s", oid_to_hex(oid));
return;