diff options
| author | saturneric <[email protected]> | 2025-11-02 15:21:58 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-02 15:21:58 +0000 |
| commit | 960134bef2cd769981cad8df0bd63cb0461e6bbe (patch) | |
| tree | 6118799a8eb7ceb1efcff4e2c0be3dd21b2f4e4f /ui-clone.c | |
| parent | chore(submodule): update `git` submodule URL and commit (diff) | |
| download | cgit-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-clone.c')
| -rw-r--r-- | ui-clone.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -14,10 +14,10 @@ #include "html.h" #include "ui-shared.h" #include "packfile.h" -#include "object-store.h" +#include "odb.h" -static int print_ref_info(const char *refname, const struct object_id *oid, - int flags, void *cb_data) +static int print_ref_info(const char *refname, const char *referent, + const struct object_id *oid, int flags, void *cb_data) { struct object *obj; @@ -116,7 +116,9 @@ void cgit_clone_objects(void) goto err; } - send_file(git_path("objects/%s", ctx.qry.path)); + char *objpath = repo_git_path(the_repository, "objects/%s", ctx.qry.path); + send_file(objpath); + free(objpath); return; err: @@ -125,5 +127,7 @@ err: void cgit_clone_head(void) { - send_file(git_path("%s", "HEAD")); + char *objpath = repo_git_path(the_repository, "%s", "HEAD"); + send_file(objpath); + free(objpath); } |
