Because HEAD and stash are per-worktree, refs.c needs to go through the files backend to write these refs. In this patch, we make one files backend internal functions public. Later, we will use this to handle reflog updates for per-worktree symbolic refs (HEAD). Signed-off-by: David Turner <dturner@xxxxxxxxxxxxxxxx> --- refs-be-files.c | 8 ++++++++ refs.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/refs-be-files.c b/refs-be-files.c index 798a995..8d1ffce 100644 --- a/refs-be-files.c +++ b/refs-be-files.c @@ -2710,6 +2710,14 @@ static int log_ref_write(const char *refname, const unsigned char *old_sha1, const unsigned char *new_sha1, const char *msg, int flags, struct strbuf *err) { + return files_log_ref_write(refname, old_sha1, new_sha1, msg, flags, + err); +} + +int files_log_ref_write(const char *refname, const unsigned char *old_sha1, + const unsigned char *new_sha1, const char *msg, + int flags, struct strbuf *err) +{ struct strbuf sb = STRBUF_INIT; int ret = log_ref_write_1(refname, old_sha1, new_sha1, msg, &sb, flags, err); diff --git a/refs.h b/refs.h index 4d8b3bb..3aad3b8 100644 --- a/refs.h +++ b/refs.h @@ -633,6 +633,11 @@ enum ref_type ref_type(const char *refname); int copy_reflog_msg(char *buf, const char *msg); +int files_log_ref_write(const char *refname, const unsigned char *old_sha1, + const unsigned char *new_sha1, const char *msg, + int flags, struct strbuf *err); + + enum expire_reflog_flags { EXPIRE_REFLOGS_DRY_RUN = 1 << 0, EXPIRE_REFLOGS_UPDATE_REF = 1 << 1, -- 2.4.2.644.g97b850b-twtrsrc -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html