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

Function string_list_add_refs_by_glob

notes.c:952–968  ·  view source on GitHub ↗

* The list argument must have strdup_strings set on it. */

Source from the content-addressed store, hash-verified

950 * The list argument must have strdup_strings set on it.
951 */
952void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
953{
954 assert(list->strdup_strings);
955 if (has_glob_specials(glob)) {
956 struct refs_for_each_ref_options opts = {
957 .pattern = glob,
958 };
959 refs_for_each_ref_ext(get_main_ref_store(the_repository),
960 string_list_add_one_ref, list, &opts);
961 } else {
962 struct object_id oid;
963 if (repo_get_oid(the_repository, glob, &oid))
964 warning("notes ref %s is invalid", glob);
965 if (!unsorted_string_list_has_string(list, glob))
966 string_list_append(list, glob);
967 }
968}
969
970void string_list_add_refs_from_colon_sep(struct string_list *list,
971 const char *globs)

Callers 4

notes_display_configFunction · 0.85
load_display_notesFunction · 0.85
notes_rewrite_configFunction · 0.85

Calls 7

has_glob_specialsFunction · 0.85
refs_for_each_ref_extFunction · 0.85
get_main_ref_storeFunction · 0.85
repo_get_oidFunction · 0.85
warningFunction · 0.85
string_list_appendFunction · 0.70

Tested by

no test coverage detected