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_log_ref_write public. Later, we will use this to handle reflog updates for per-worktree symbolic refs (HEAD). Signed-off-by: David Turner <dturner@xxxxxxxxxxxxxxxx> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx> --- 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 680641d..0eabea9 100644 --- a/refs-be-files.c +++ b/refs-be-files.c @@ -2732,6 +2732,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 ce99aef..f97a2e4 100644 --- a/refs.h +++ b/refs.h @@ -619,6 +619,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.658.g6d8523e-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