expose got_ref_resolve_symbolic() at the public library API This will be needed by a future 'got send' command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/include/got_reference.h b/include/got_reference.h
index d242c36..57e9e86 100644
--- a/include/got_reference.h
+++ b/include/got_reference.h
@@ -68,7 +68,11 @@ time_t got_ref_get_mtime(struct got_reference *);
*/
struct got_reference *got_ref_dup(struct got_reference *);
-/* Attempt to resolve a reference to an object ID. */
+/* Attempt to resolve a symbolic reference to a non-symbolic one. */
+const struct got_error *got_ref_resolve_symbolic(struct got_reference **,
+ struct got_repository *, struct got_reference *);
+
+/* Attempt to resolve a reference (symbolic or not) to an object ID. */
const struct got_error *got_ref_resolve(struct got_object_id **,
struct got_repository *, struct got_reference *);
diff --git a/lib/reference.c b/lib/reference.c
index a326d18..951594f 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -592,8 +592,8 @@ got_reflist_entry_dup(struct got_reflist_entry **newp,
return NULL;
}
-static const struct got_error *
-resolve_symbolic_ref(struct got_reference **resolved,
+const struct got_error *
+got_ref_resolve_symbolic(struct got_reference **resolved,
struct got_repository *repo, struct got_reference *ref)
{
struct got_reference *nextref;
@@ -604,7 +604,7 @@ resolve_symbolic_ref(struct got_reference **resolved,
return err;
if (nextref->flags & GOT_REF_IS_SYMBOLIC)
- err = resolve_symbolic_ref(resolved, repo, nextref);
+ err = got_ref_resolve_symbolic(resolved, repo, nextref);
else
*resolved = got_ref_dup(nextref);
@@ -624,7 +624,7 @@ ref_resolve(struct got_object_id **id, struct got_repository *repo,
if (ref->flags & GOT_REF_IS_SYMBOLIC) {
struct got_reference *resolved = NULL;
- err = resolve_symbolic_ref(&resolved, repo, ref);
+ err = got_ref_resolve_symbolic(&resolved, repo, ref);
if (err == NULL)
err = ref_resolve(id, repo, resolved, --recursion);
if (resolved)