const char *prefix,
struct repository *repo UNUSED )
{
+ struct refs_for_each_ref_options for_each_ref_opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
int contains = 0;
struct option options[] = {
OPT_BOOL(0, "contains", &contains, N_("find the tag that comes after the commit")),
}
hashmap_init(&names, commit_name_neq, NULL, 0);
- refs_for_each_rawref(get_main_ref_store(the_repository), get_name,
- NULL);
+ refs_for_each_ref_ext(get_main_ref_store(the_repository),
+ get_name, NULL, &for_each_ref_opts);
if (!hashmap_get_size(&names) && !always)
die(_("No names found, cannot describe anything."));
static void snapshot_refs(struct snapshot *snap, int argc, const char **argv)
{
+ struct refs_for_each_ref_options opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
struct worktree **worktrees, **p;
const char *head_points_at;
struct object_id head_oid;
return;
}
- refs_for_each_rawref(get_main_ref_store(the_repository),
- snapshot_ref, snap);
+ refs_for_each_ref_ext(get_main_ref_store(the_repository),
+ snapshot_ref, snap, &opts);
worktrees = get_worktrees();
for (p = worktrees; *p; p++) {
static void mark_tips(struct fetch_negotiator *negotiator,
const struct oid_array *negotiation_tips)
{
+ struct refs_for_each_ref_options opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
int i;
if (!negotiation_tips) {
- refs_for_each_rawref(get_main_ref_store(the_repository),
- rev_list_insert_ref_oid, negotiator);
+ refs_for_each_ref_ext(get_main_ref_store(the_repository),
+ rev_list_insert_ref_oid, negotiator, &opts);
return;
}
*/
trace2_region_enter("fetch-pack", "mark_complete_local_refs", NULL);
if (!args->deepen) {
- refs_for_each_rawref(get_main_ref_store(the_repository),
- mark_complete_oid, NULL);
+ struct refs_for_each_ref_options opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
+
+ refs_for_each_ref_ext(get_main_ref_store(the_repository),
+ mark_complete_oid, NULL, &opts);
for_each_cached_alternate(NULL, mark_alternate_complete);
if (cutoff)
mark_recent_complete_commits(args, cutoff);
.indent = indent,
.dry_run = dry_run,
};
- refs_for_each_rawref(refs, warn_if_dangling_symref, &data);
+ struct refs_for_each_ref_options opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
+ refs_for_each_ref_ext(refs, warn_if_dangling_symref, &data, &opts);
}
int refs_for_each_tag_ref(struct ref_store *refs, refs_for_each_cb cb, void *cb_data)
return refs_for_each_ref_ext(refs, cb, cb_data, &opts);
}
-int refs_for_each_rawref(struct ref_store *refs, refs_for_each_cb fn, void *cb_data)
-{
- return refs_for_each_rawref_in(refs, "", fn, cb_data);
-}
-
int refs_for_each_rawref_in(struct ref_store *refs, const char *prefix,
refs_for_each_cb cb, void *cb_data)
{
refs_for_each_cb fn, void *cb_data);
/* can be used to learn about broken ref and symref */
-int refs_for_each_rawref(struct ref_store *refs, refs_for_each_cb fn, void *cb_data);
int refs_for_each_rawref_in(struct ref_store *refs, const char *prefix,
refs_for_each_cb fn, void *cb_data);
struct ref_transaction *transaction,
struct strbuf *err)
{
+ struct refs_for_each_ref_options opts = {
+ .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
+ };
size_t i;
int ret = 0;
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
* so here we really only check that none of the references
* that we are creating already exists.
*/
- if (refs_for_each_rawref(&refs->base, ref_present,
- &transaction->refnames))
+ if (refs_for_each_ref_ext(&refs->base, ref_present,
+ &transaction->refnames, &opts))
BUG("initial ref transaction called with existing refs");
packed_transaction = ref_store_transaction_begin(refs->packed_ref_store,