libgit2

git_worktree_is_prunable

Version:

Is the worktree prunable with the given options?

A worktree is not prunable in the following scenarios:

  • the worktree is linking to a valid on-disk worktree. The valid member will cause this check to be ignored.
  • the worktree is locked. The locked flag will cause this check to be ignored.

If the worktree is not valid and not locked or if the above flags have been passed in, this function will return a positive value. If the worktree is not prunable, an error message will be set (visible in giterr_last) with details about why.

Signature

int git_worktree_is_prunable(git_worktree *wt, git_worktree_prune_options *opts);

Parameters

In
wt

Worktree to check.

In
opts

The prunable options.

Returns

int

1 if the worktree is prunable, 0 otherwise, or an error code.

Versions