summaryrefslogtreecommitdiff
path: root/include/git2/worktree.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-04-30 09:27:47 +0100
committerGitHub <noreply@github.com>2018-04-30 09:27:47 +0100
commitb33b6d33c319d847e518179364c8e6676f5faf77 (patch)
tree87fb390932e05962f823b6393f56065ba088a37f /include/git2/worktree.h
parent5ace149434d8609133d59cd21f32c21b753adc3a (diff)
parent3da1ad20a3f19fcb4e0eea3f4a08509e5811aca7 (diff)
downloadlibgit2-b33b6d33c319d847e518179364c8e6676f5faf77.tar.gz
Merge pull request #4640 from mkeeler/worktree-convenience2
worktree: add functions to get name and path
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 e975c9239..d6d4ce5cf 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -150,6 +150,24 @@ GIT_EXTERN(int) git_worktree_unlock(git_worktree *wt);
GIT_EXTERN(int) git_worktree_is_locked(git_buf *reason, const git_worktree *wt);
/**
+ * Retrieve the name of the worktree
+ *
+ * @param wt Worktree to get the name for
+ * @return The worktree's name. The pointer returned is valid for the
+ * lifetime of the git_worktree
+ */
+GIT_EXTERN(const char *) git_worktree_name(const git_worktree *wt);
+
+/**
+ * Retrieve the filesystem path for the worktree
+ *
+ * @param wt Worktree to get the path for
+ * @return The worktree's filesystem path. The pointer returned
+ * is valid for the lifetime of the git_worktree.
+ */
+GIT_EXTERN(const char *) git_worktree_path(const git_worktree *wt);
+
+/**
* Flags which can be passed to git_worktree_prune to alter its
* behavior.
*/