MCPcopy Create free account
hub / github.com/git/git / get_stale_heads

Function get_stale_heads

remote.c:2589–2605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2587}
2588
2589struct ref *get_stale_heads(struct refspec *rs, struct ref *fetch_map)
2590{
2591 struct ref *ref, *stale_refs = NULL;
2592 struct string_list ref_names = STRING_LIST_INIT_NODUP;
2593 struct stale_heads_info info;
2594
2595 info.ref_names = &ref_names;
2596 info.stale_refs_tail = &stale_refs;
2597 info.rs = rs;
2598 for (ref = fetch_map; ref; ref = ref->next)
2599 string_list_append(&ref_names, ref->name);
2600 string_list_sort(&ref_names);
2601 refs_for_each_ref(get_main_ref_store(the_repository),
2602 get_stale_heads_cb, &info);
2603 string_list_clear(&ref_names, 0);
2604 return stale_refs;
2605}
2606
2607/*
2608 * Compare-and-swap

Callers 2

prune_refsFunction · 0.85
get_ref_statesFunction · 0.85

Calls 5

refs_for_each_refFunction · 0.85
get_main_ref_storeFunction · 0.85
string_list_clearFunction · 0.85
string_list_appendFunction · 0.70
string_list_sortFunction · 0.70

Tested by

no test coverage detected