| 260 | } |
| 261 | |
| 262 | struct worktree *find_worktree(struct worktree **list, |
| 263 | const char *prefix, |
| 264 | const char *arg) |
| 265 | { |
| 266 | struct worktree *wt; |
| 267 | char *to_free = NULL; |
| 268 | |
| 269 | if ((wt = find_worktree_by_suffix(list, arg))) |
| 270 | return wt; |
| 271 | |
| 272 | if (prefix) |
| 273 | arg = to_free = prefix_filename(prefix, arg); |
| 274 | wt = find_worktree_by_path(list, arg); |
| 275 | free(to_free); |
| 276 | return wt; |
| 277 | } |
| 278 | |
| 279 | struct worktree *find_worktree_by_path(struct worktree **list, const char *p) |
| 280 | { |
no test coverage detected