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

Function worktree_basename

builtin/worktree.c:297–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static 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 */
317static void check_candidate_path(const char *path,

Callers 3

add_worktreeFunction · 0.85
dwim_branchFunction · 0.85
addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected