Skip to content

Commit

Permalink
object-name: expose get_parent function
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mjcheetham committed Apr 23, 2024
1 parent 10f928d commit 40800dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions object-name.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions object-name.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 40800dd

Please sign in to comment.