From 40800ddc60c985372cfdbbff24da0c30a60bbef8 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Tue, 23 Apr 2024 15:25:14 -0700 Subject: [PATCH] object-name: expose get_parent function Expose the static `get_parent` function so we can use it in the odb--daemon implementation of the `get-parent` IPC call. Signed-off-by: Matthew John Cheetham --- object-name.c | 6 +++--- object-name.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/object-name.c b/object-name.c index 523af6f64f3351..55dc8a67d4241c 100644 --- a/object-name.c +++ b/object-name.c @@ -1081,9 +1081,9 @@ static int get_oid_basic(struct repository *r, const char *str, int len, return 0; } -static enum get_oid_result get_parent(struct repository *r, - const char *name, int len, - struct object_id *result, int idx) +enum get_oid_result get_parent(struct repository *r, + const char *name, int len, + struct object_id *result, int idx) { struct object_id oid; enum get_oid_result ret = get_oid_1(r, name, len, &oid, diff --git a/object-name.h b/object-name.h index 064ddc97d1fe99..34277c60ec9d5e 100644 --- a/object-name.h +++ b/object-name.h @@ -121,6 +121,10 @@ struct object *repo_peel_to_type(struct repository *r, const char *name, int namelen, struct object *o, enum object_type); +enum get_oid_result get_parent(struct repository *r, + const char *name, int len, + struct object_id *result, int idx); + /* Convert to/from hex/sha1 representation */ #define MINIMUM_ABBREV minimum_abbrev #define DEFAULT_ABBREV default_abbrev