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

Function worktree_prune_reason

worktree.c:327–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327const char *worktree_prune_reason(struct worktree *wt, timestamp_t expire)
328{
329 struct strbuf reason = STRBUF_INIT;
330 char *path = NULL;
331
332 if (is_main_worktree(wt))
333 return NULL;
334 if (wt->prune_reason_valid)
335 return wt->prune_reason;
336
337 if (should_prune_worktree(wt->id, &reason, &path, expire))
338 wt->prune_reason = strbuf_detach(&reason, NULL);
339 wt->prune_reason_valid = 1;
340
341 strbuf_release(&reason);
342 free(path);
343 return wt->prune_reason;
344}
345
346/* convenient wrapper to deal with NULL strbuf */
347__attribute__((format (printf, 2, 3)))

Callers 2

show_worktree_porcelainFunction · 0.85
show_worktreeFunction · 0.85

Calls 4

is_main_worktreeFunction · 0.85
should_prune_worktreeFunction · 0.85
strbuf_detachFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected