Merge branch 'mh/tidy-ref-update-flags'
Code clean-up in refs API implementation. * mh/tidy-ref-update-flags: refs: update some more docs to use "oid" rather than "sha1" write_packed_entry(): take `object_id` arguments refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING` refs: rename constant `REF_NODEREF` to `REF_NO_DEREF` refs: tidy up and adjust visibility of the `ref_update` flags ref_transaction_add_update(): remove a check ref_transaction_update(): die on disallowed flags prune_ref(): call `ref_transaction_add_update()` directly files_transaction_prepare(): don't leak flags to packed transaction
This commit is contained in:
@ -689,7 +689,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
|
||||
} else if (our) {
|
||||
struct commit *c = lookup_commit_reference(&our->old_oid);
|
||||
/* --branch specifies a non-branch (i.e. tags), detach HEAD */
|
||||
update_ref(msg, "HEAD", &c->object.oid, NULL, REF_NODEREF,
|
||||
update_ref(msg, "HEAD", &c->object.oid, NULL, REF_NO_DEREF,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
} else if (remote) {
|
||||
/*
|
||||
@ -697,7 +697,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
|
||||
* HEAD points to a branch but we don't know which one.
|
||||
* Detach HEAD in all these cases.
|
||||
*/
|
||||
update_ref(msg, "HEAD", &remote->old_oid, NULL, REF_NODEREF,
|
||||
update_ref(msg, "HEAD", &remote->old_oid, NULL, REF_NO_DEREF,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user