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

Function delete_git_dir

builtin/worktree.c:149–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static int delete_git_dir(const char *id)
150{
151 struct strbuf sb = STRBUF_INIT;
152 int ret;
153
154 repo_common_path_append(the_repository, &sb, "worktrees/%s", id);
155 ret = remove_dir_recursively(&sb, 0);
156 if (ret < 0 && errno == ENOTDIR)
157 ret = unlink(sb.buf);
158 if (ret)
159 error_errno(_("failed to delete '%s'"), sb.buf);
160 strbuf_release(&sb);
161 return ret;
162}
163
164static void delete_worktrees_dir_if_empty(void)
165{

Callers 3

prune_worktreeFunction · 0.85
check_candidate_pathFunction · 0.85
remove_worktreeFunction · 0.85

Calls 4

repo_common_path_appendFunction · 0.85
remove_dir_recursivelyFunction · 0.85
error_errnoFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected