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

Function get_origin

blame.c:87–103  ·  view source on GitHub ↗

* Locate an existing origin or create a new one. * This moves the origin to front position in the commit util list. */

Source from the content-addressed store, hash-verified

85 * This moves the origin to front position in the commit util list.
86 */
87static struct blame_origin *get_origin(struct commit *commit, const char *path)
88{
89 struct blame_origin *o, *l;
90
91 for (o = get_blame_suspects(commit), l = NULL; o; l = o, o = o->next) {
92 if (!strcmp(o->path, path)) {
93 /* bump to front */
94 if (l) {
95 l->next = o->next;
96 o->next = get_blame_suspects(commit);
97 set_blame_suspects(commit, o);
98 }
99 return blame_origin_incref(o);
100 }
101 }
102 return make_origin(commit, path);
103}
104
105
106

Callers 4

find_originFunction · 0.85
find_renameFunction · 0.85
find_copy_in_parentFunction · 0.85
setup_scoreboardFunction · 0.85

Calls 4

get_blame_suspectsFunction · 0.85
set_blame_suspectsFunction · 0.85
blame_origin_increfFunction · 0.85
make_originFunction · 0.85

Tested by

no test coverage detected