refs: move original_update_refname to 'refs.c'

The files backend and the reftable backend implement
`original_update_refname` to obtain the original refname of the update.
Move it out to 'refs.c' and only expose it internally to the refs
library. This will be used in an upcoming commit to also introduce
another common functionality for the two backends.

We also rename the function to `ref_update_original_update_refname` to
keep it consistent with the upcoming other 'ref_update_*' functions
that'll be introduced.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Karthik Nayak
2024-05-07 14:58:55 +02:00
committed by Junio C Hamano
parent a8ae923f85
commit e9965ba477
4 changed files with 25 additions and 33 deletions

View File

@ -749,4 +749,9 @@ void base_ref_store_init(struct ref_store *refs, struct repository *repo,
*/
struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_store *store);
/*
* Return the refname under which update was originally requested.
*/
const char *ref_update_original_update_refname(struct ref_update *update);
#endif /* REFS_REFS_INTERNAL_H */