| 295 | } |
| 296 | |
| 297 | static const char *worktree_basename(const char *path, int *olen) |
| 298 | { |
| 299 | const char *name; |
| 300 | int len; |
| 301 | |
| 302 | len = strlen(path); |
| 303 | while (len && is_dir_sep(path[len - 1])) |
| 304 | len--; |
| 305 | |
| 306 | for (name = path + len - 1; name > path; name--) |
| 307 | if (is_dir_sep(*name)) { |
| 308 | name++; |
| 309 | break; |
| 310 | } |
| 311 | |
| 312 | *olen = len; |
| 313 | return name; |
| 314 | } |
| 315 | |
| 316 | /* check that path is viable location for worktree */ |
| 317 | static void check_candidate_path(const char *path, |
no outgoing calls
no test coverage detected