MCPcopy Index your code
hub / github.com/git/git / is_current_worktree

Function is_current_worktree

worktree.c:59–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static int is_current_worktree(struct worktree *wt)
60{
61 char *git_dir = absolute_pathdup(repo_get_git_dir(wt->repo));
62 char *wt_git_dir = get_worktree_git_dir(wt);
63 int is_current = !fspathcmp(git_dir, absolute_path(wt_git_dir));
64 free(wt_git_dir);
65 free(git_dir);
66 return is_current;
67}
68
69struct worktree *get_current_worktree(struct repository *repo)
70{

Callers 2

get_main_worktreeFunction · 0.85
get_linked_worktreeFunction · 0.85

Calls 4

absolute_pathdupFunction · 0.85
repo_get_git_dirFunction · 0.85
get_worktree_git_dirFunction · 0.85
absolute_pathFunction · 0.85

Tested by

no test coverage detected