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

Function delete_git_work_tree

builtin/worktree.c:1364–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1362}
1363
1364static int delete_git_work_tree(struct worktree *wt)
1365{
1366 struct strbuf sb = STRBUF_INIT;
1367 int ret = 0;
1368
1369 strbuf_addstr(&sb, wt->path);
1370 if (remove_dir_recursively(&sb, 0)) {
1371 error_errno(_("failed to delete '%s'"), sb.buf);
1372 ret = -1;
1373 }
1374 strbuf_release(&sb);
1375 return ret;
1376}
1377
1378static int remove_worktree(int ac, const char **av, const char *prefix,
1379 struct repository *repo UNUSED)

Callers 1

remove_worktreeFunction · 0.85

Calls 4

strbuf_addstrFunction · 0.85
remove_dir_recursivelyFunction · 0.85
error_errnoFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected