diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-01 21:11:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-01 21:11:00 +0300 |
commit | 34363403a28ad4d0bd76c5aa7351293b6e4a4e47 (patch) | |
tree | 3036703a7ca8b3f1846f8d6745d8609c57ceba56 /refs.c | |
parent | e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e (diff) | |
parent | 583bc419235cedc6a2ba12593f058a9f812b9594 (diff) |
Merge branch 'ps/fetch-atomic' into ps/fetch-mirror-optim
* ps/fetch-atomic:
fetch: make `--atomic` flag cover pruning of refs
fetch: make `--atomic` flag cover backfilling of tags
refs: add interface to iterate over queued transactional updates
fetch: report errors when backfilling tags fails
fetch: control lifecycle of FETCH_HEAD in a single place
fetch: backfill tags before setting upstream
fetch: increase test coverage of fetches
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -2417,6 +2417,22 @@ int initial_ref_transaction_commit(struct ref_transaction *transaction, return refs->be->initial_transaction_commit(refs, transaction, err); } +void ref_transaction_for_each_queued_update(struct ref_transaction *transaction, + ref_transaction_for_each_queued_update_fn cb, + void *cb_data) +{ + int i; + + for (i = 0; i < transaction->nr; i++) { + struct ref_update *update = transaction->updates[i]; + + cb(update->refname, + (update->flags & REF_HAVE_OLD) ? &update->old_oid : NULL, + (update->flags & REF_HAVE_NEW) ? &update->new_oid : NULL, + cb_data); + } +} + int refs_delete_refs(struct ref_store *refs, const char *logmsg, struct string_list *refnames, unsigned int flags) { |