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

Function has_worktrees

refs.c:3314–3328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3312}
3313
3314static int has_worktrees(void)
3315{
3316 struct worktree **worktrees = get_worktrees();
3317 int ret = 0;
3318 size_t i;
3319
3320 for (i = 0; worktrees[i]; i++) {
3321 if (is_main_worktree(worktrees[i]))
3322 continue;
3323 ret = 1;
3324 }
3325
3326 free_worktrees(worktrees);
3327 return ret;
3328}
3329
3330int repo_migrate_ref_storage_format(struct repository *repo,
3331 enum ref_storage_format format,

Callers 1

Calls 3

get_worktreesFunction · 0.85
is_main_worktreeFunction · 0.85
free_worktreesFunction · 0.85

Tested by

no test coverage detected