diff --git a/refs.c b/refs.c index 62a7621025..7c1e206e08 100644 --- a/refs.c +++ b/refs.c @@ -940,7 +940,8 @@ int ref_transaction_update(struct ref_transaction *transaction, return -1; } - flags &= REF_TRANSACTION_UPDATE_ALLOWED_FLAGS; + if (flags & ~REF_TRANSACTION_UPDATE_ALLOWED_FLAGS) + BUG("illegal flags 0x%x passed to ref_transaction_update()", flags); flags |= (new_oid ? REF_HAVE_NEW : 0) | (old_oid ? REF_HAVE_OLD : 0);