Merge branch 'hn/create-reflog-simplify' into hn/reftable-coverity-fixes

* hn/create-reflog-simplify:
  refs: drop force_create argument of create_reflog API
This commit is contained in:
Junio C Hamano
2021-12-07 12:45:15 -08:00
10 changed files with 18 additions and 23 deletions

View File

@@ -182,11 +182,10 @@ static int cmd_reflog_exists(struct ref_store *refs, const char **argv)
static int cmd_create_reflog(struct ref_store *refs, const char **argv)
{
const char *refname = notnull(*argv++, "refname");
int force_create = arg_flags(*argv++, "force-create");
struct strbuf err = STRBUF_INIT;
int ret;
ret = refs_create_reflog(refs, refname, force_create, &err);
ret = refs_create_reflog(refs, refname, &err);
if (err.len)
puts(err.buf);
return ret;

View File

@@ -108,7 +108,7 @@ test_expect_success 'delete_reflog(HEAD)' '
'
test_expect_success 'create-reflog(HEAD)' '
$RUN create-reflog HEAD 1 &&
$RUN create-reflog HEAD &&
git reflog exists HEAD
'

View File

@@ -92,7 +92,7 @@ test_expect_success 'delete_reflog() not allowed' '
'
test_expect_success 'create-reflog() not allowed' '
test_must_fail $RUN create-reflog HEAD 1
test_must_fail $RUN create-reflog HEAD
'
test_done