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

Function find_symref

upload-pack.c:1280–1295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278}
1279
1280static int find_symref(const struct reference *ref, void *cb_data)
1281{
1282 const char *symref_target;
1283 struct string_list_item *item;
1284 int flag;
1285
1286 if ((ref->flags & REF_ISSYMREF) == 0)
1287 return 0;
1288 symref_target = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
1289 ref->name, 0, NULL, &flag);
1290 if (!symref_target || (flag & REF_ISSYMREF) == 0)
1291 die("'%s' is a symref but it is not?", ref->name);
1292 item = string_list_append(cb_data, strip_namespace(ref->name));
1293 item->util = xstrdup(strip_namespace(symref_target));
1294 return 0;
1295}
1296
1297static int parse_object_filter_config(const char *var, const char *value,
1298 const struct key_value_info *kvi,

Callers

nothing calls this directly

Calls 6

refs_resolve_ref_unsafeFunction · 0.85
get_main_ref_storeFunction · 0.85
strip_namespaceFunction · 0.85
xstrdupFunction · 0.85
dieFunction · 0.70
string_list_appendFunction · 0.70

Tested by

no test coverage detected