aboutsummaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index 93bfe5b30c..4c31795581 100644
--- a/refs.c
+++ b/refs.c
@@ -1095,6 +1095,13 @@ int ref_transaction_update(struct ref_transaction *transaction,
if (flags & ~REF_TRANSACTION_UPDATE_ALLOWED_FLAGS)
BUG("illegal flags 0x%x passed to ref_transaction_update()", flags);
+ /*
+ * Clear flags outside the allowed set; this should be a noop because
+ * of the BUG() check above, but it works around a -Wnonnull warning
+ * with some versions of "gcc -O3".
+ */
+ flags &= REF_TRANSACTION_UPDATE_ALLOWED_FLAGS;
+
flags |= (new_oid ? REF_HAVE_NEW : 0) | (old_oid ? REF_HAVE_OLD : 0);
ref_transaction_add_update(transaction, refname, flags,
@@ -2367,16 +2374,15 @@ int reflog_exists(const char *refname)
}
int refs_create_reflog(struct ref_store *refs, const char *refname,
- int force_create, struct strbuf *err)
+ struct strbuf *err)
{
- return refs->be->create_reflog(refs, refname, force_create, err);
+ return refs->be->create_reflog(refs, refname, err);
}
-int safe_create_reflog(const char *refname, int force_create,
- struct strbuf *err)
+int safe_create_reflog(const char *refname, struct strbuf *err)
{
return refs_create_reflog(get_main_ref_store(the_repository), refname,
- force_create, err);
+ err);
}
int refs_delete_reflog(struct ref_store *refs, const char *refname)