aboutsummaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/worktree.h b/worktree.h
index e4bcccdc0a..d19ec29dbb 100644
--- a/worktree.h
+++ b/worktree.h
@@ -16,7 +16,7 @@ struct worktree {
struct object_id head_oid;
int is_detached;
int is_bare;
- int is_current;
+ int is_current; /* does `path` match `repo->worktree` */
int lock_reason_valid; /* private */
int prune_reason_valid; /* private */
};
@@ -39,13 +39,18 @@ struct worktree **get_worktrees(void);
struct worktree **get_worktrees_without_reading_head(void);
/*
+ * Construct a struct worktree corresponding to repo->gitdir and
+ * repo->worktree.
+ */
+struct worktree *get_worktree_from_repository(struct repository *repo);
+
+/*
* Returns 1 if linked worktrees exist, 0 otherwise.
*/
int submodule_uses_worktrees(const char *path);
/*
* Return git dir of the worktree. Note that the path may be relative.
- * If wt is NULL, git dir of current worktree is returned.
*/
char *get_worktree_git_dir(const struct worktree *wt);
@@ -191,7 +196,7 @@ int is_shared_symref(const struct worktree *wt,
* Similar to head_ref() for all HEADs _except_ one from the current
* worktree, which is covered by head_ref().
*/
-int other_head_refs(each_ref_fn fn, void *cb_data);
+int other_head_refs(refs_for_each_cb fn, void *cb_data);
int is_worktree_being_rebased(const struct worktree *wt, const char *target);
int is_worktree_being_bisected(const struct worktree *wt, const char *target);
@@ -234,7 +239,7 @@ int init_worktree_config(struct repository *r);
* dotgit: "/path/to/foo/.git"
* gitdir: "/path/to/repo/worktrees/foo/gitdir"
*/
-void write_worktree_linking_files(struct strbuf dotgit, struct strbuf gitdir,
+void write_worktree_linking_files(const char *dotgit, const char *gitdir,
int use_relative_paths);
#endif