/* Acquire all locks while verifying old values */
for (i = 0; i < n; i++) {
struct ref_update *update = updates[i];
- int flags = update->flags;
if (is_null_sha1(update->new_sha1))
- flags |= REF_DELETING;
+ update->flags |= REF_DELETING;
update->lock = lock_ref_sha1_basic(update->refname,
(update->have_old ?
update->old_sha1 :
NULL),
NULL,
- flags,
+ update->flags,
&update->type);
if (!update->lock) {
ret = (errno == ENOTDIR)
for (i = 0; i < n; i++) {
struct ref_update *update = updates[i];
- if (!is_null_sha1(update->new_sha1)) {
+ if (!(update->flags & REF_DELETING)) {
if (!update->lock->force_write &&
!hashcmp(update->lock->old_sha1, update->new_sha1)) {
unlock_ref(update->lock);