| 2587 | } |
| 2588 | |
| 2589 | struct 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 |
no test coverage detected