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

Function annotate_refs_with_symref_info

connect.c:209–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209static void annotate_refs_with_symref_info(struct ref *ref)
210{
211 struct string_list symref = STRING_LIST_INIT_DUP;
212 size_t offset = 0;
213
214 while (1) {
215 size_t len;
216 const char *val;
217
218 val = next_server_feature_value("symref", &len, &offset);
219 if (!val)
220 break;
221 parse_one_symref_info(&symref, val, len);
222 }
223 string_list_sort(&symref);
224
225 for (; ref; ref = ref->next) {
226 struct string_list_item *item;
227 item = string_list_lookup(&symref, ref->name);
228 if (!item)
229 continue;
230 ref->symref = xstrdup((char *)item->util);
231 }
232 string_list_clear(&symref, 0);
233}
234
235static void process_capabilities(struct packet_reader *reader, size_t *linelen)
236{

Callers 1

get_remote_headsFunction · 0.85

Calls 6

parse_one_symref_infoFunction · 0.85
string_list_lookupFunction · 0.85
xstrdupFunction · 0.85
string_list_clearFunction · 0.85
string_list_sortFunction · 0.70

Tested by

no test coverage detected