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

Function append_similar_ref

help.c:862–873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860};
861
862static int append_similar_ref(const struct reference *ref, void *cb_data)
863{
864 struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
865 const char *branch = strrchr(ref->name, '/') + 1;
866
867 /* A remote branch of the same name is deemed similar */
868 if (starts_with(ref->name, "refs/remotes/") &&
869 !strcmp(branch, cb->base_ref))
870 string_list_append_nodup(cb->similar_refs,
871 refs_shorten_unambiguous_ref(get_main_ref_store(the_repository), ref->name, 1));
872 return 0;
873}
874
875static struct string_list guess_refs(const char *ref)
876{

Callers

nothing calls this directly

Calls 4

starts_withFunction · 0.85
string_list_append_nodupFunction · 0.85
get_main_ref_storeFunction · 0.85

Tested by

no test coverage detected