int forcing = 0;
struct ref_transaction *transaction;
struct strbuf err = STRBUF_INIT;
+ int flags = 0;
char *msg;
if (track == BRANCH_TRACK_OVERRIDE)
goto cleanup;
if (reflog)
- log_all_ref_updates = LOG_REFS_NORMAL;
+ flags |= REF_FORCE_CREATE_REFLOG;
if (forcing)
msg = xstrfmt("branch: Reset to %s", start_name);
if (!transaction ||
ref_transaction_update(transaction, ref.buf,
&oid, forcing ? NULL : null_oid(),
- NULL, NULL, 0, msg, &err) ||
+ NULL, NULL, flags, msg, &err) ||
ref_transaction_commit(transaction, &err))
die("%s", err.buf);
ref_transaction_free(transaction);