summaryrefslogtreecommitdiff
path: root/include/git2/worktree.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-02-03 13:52:23 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-13 11:13:08 +0100
commit1ba242c9ab0eb323abed1b3bbc770aeb3367d855 (patch)
tree0ecaec9fe31f15bb81c9ffce27c5f80621b82745 /include/git2/worktree.h
parent3f3a4ce7bcd9862ef1eb87dfc5871e4012159244 (diff)
downloadlibgit2-1ba242c9ab0eb323abed1b3bbc770aeb3367d855.tar.gz
worktree: extract git_worktree_is_prunable
Diffstat (limited to 'include/git2/worktree.h')
-rw-r--r--include/git2/worktree.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h
index ec869fb59..cad1284fa 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -126,6 +126,24 @@ typedef enum {
} git_worktree_prune_t;
/**
+ * Is the worktree prunable with the given set of flags?
+ *
+ * A worktree is not prunable in the following scenarios:
+ *
+ * - the worktree is linking to a valid on-disk worktree. The
+ * GIT_WORKTREE_PRUNE_VALID flag will cause this check to be
+ * ignored.
+ * - the worktree is not valid but locked. The
+ * GIT_WORKRTEE_PRUNE_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.
+ */
+GIT_EXTERN(int) git_worktree_is_prunable(git_worktree *wt, unsigned flags);
+
+/**
* Prune working tree
*
* Prune the working tree, that is remove the git data