* Locate an existing origin or create a new one. * This moves the origin to front position in the commit util list. */
| 85 | * This moves the origin to front position in the commit util list. |
| 86 | */ |
| 87 | static 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 |
no test coverage detected