summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index a5f9ffaa45..f88928de74 100644
--- a/refs.c
+++ b/refs.c
@@ -1393,11 +1393,6 @@ int ref_transaction_update_reflog(struct ref_transaction *transaction,
update = ref_transaction_add_update(transaction, refname, flags,
new_oid, old_oid, NULL, NULL,
committer_info, msg);
- /*
- * While we do set the old_oid value, we unset the flag to skip
- * old_oid verification which only makes sense for refs.
- */
- update->flags &= ~REF_HAVE_OLD;
update->index = index;
/*
@@ -3318,6 +3313,9 @@ done:
int ref_update_expects_existing_old_ref(struct ref_update *update)
{
+ if (update->flags & REF_LOG_ONLY)
+ return 0;
+
return (update->flags & REF_HAVE_OLD) &&
(!is_null_oid(&update->old_oid) || update->old_target);
}