diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-11-22 15:19:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-22 20:01:25 +0100 |
commit | 7b089120d9e0065978da461f8ccf42000e6760a4 (patch) | |
tree | cf891aed11ed2574032887f06c3987be0783ab5f /refs | |
parent | Git 2.34 (diff) | |
download | git-7b089120d9e0065978da461f8ccf42000e6760a4.tar.xz git-7b089120d9e0065978da461f8ccf42000e6760a4.zip |
refs: drop force_create argument of create_reflog API
There is only one caller, builtin/checkout.c, and it hardcodes
force_create=1.
This argument was introduced in abd0cd3a301 (refs: new public ref function:
safe_create_reflog, 2015-07-21), which promised to immediately use it in a
follow-on commit, but that never happened.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/debug.c | 5 | ||||
-rw-r--r-- | refs/files-backend.c | 5 | ||||
-rw-r--r-- | refs/packed-backend.c | 3 | ||||
-rw-r--r-- | refs/refs-internal.h | 2 |
4 files changed, 6 insertions, 9 deletions
diff --git a/refs/debug.c b/refs/debug.c index 8667c64023..756d07c724 100644 --- a/refs/debug.c +++ b/refs/debug.c @@ -339,11 +339,10 @@ static int debug_reflog_exists(struct ref_store *ref_store, const char *refname) } static int debug_create_reflog(struct ref_store *ref_store, const char *refname, - int force_create, struct strbuf *err) + struct strbuf *err) { struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; - int res = drefs->refs->be->create_reflog(drefs->refs, refname, - force_create, err); + int res = drefs->refs->be->create_reflog(drefs->refs, refname, err); trace_printf_key(&trace_refs, "create_reflog: %s: %d\n", refname, res); return res; } diff --git a/refs/files-backend.c b/refs/files-backend.c index 151b0056fe..00f596dd68 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1639,15 +1639,14 @@ error: return -1; } -static int files_create_reflog(struct ref_store *ref_store, - const char *refname, int force_create, +static int files_create_reflog(struct ref_store *ref_store, const char *refname, struct strbuf *err) { struct files_ref_store *refs = files_downcast(ref_store, REF_STORE_WRITE, "create_reflog"); int fd; - if (log_ref_setup(refs, refname, force_create, &fd, err)) + if (log_ref_setup(refs, refname, 1, &fd, err)) return -1; if (fd >= 0) diff --git a/refs/packed-backend.c b/refs/packed-backend.c index 1c5211b03e..472458b844 100644 --- a/refs/packed-backend.c +++ b/refs/packed-backend.c @@ -1628,8 +1628,7 @@ static int packed_reflog_exists(struct ref_store *ref_store, } static int packed_create_reflog(struct ref_store *ref_store, - const char *refname, int force_create, - struct strbuf *err) + const char *refname, struct strbuf *err) { BUG("packed reference store does not support reflogs"); } diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 12224742ed..5b40b3bbbf 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -606,7 +606,7 @@ typedef int for_each_reflog_ent_reverse_fn(struct ref_store *ref_store, void *cb_data); typedef int reflog_exists_fn(struct ref_store *ref_store, const char *refname); typedef int create_reflog_fn(struct ref_store *ref_store, const char *refname, - int force_create, struct strbuf *err); + struct strbuf *err); typedef int delete_reflog_fn(struct ref_store *ref_store, const char *refname); typedef int reflog_expire_fn(struct ref_store *ref_store, const char *refname, |