diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-13 14:37:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-13 14:37:26 +0100 |
commit | e146cc97be4c054c60d38e9f4edcdc33205bf563 (patch) | |
tree | b36de8c572922ac1c0fda47c028cd7ccd8fd7a35 /worktree.h | |
parent | Merge branch 'bp/refresh-index-using-preload' (diff) | |
parent | git-worktree.txt: correct linkgit command name (diff) | |
download | git-e146cc97be4c054c60d38e9f4edcdc33205bf563.tar.xz git-e146cc97be4c054c60d38e9f4edcdc33205bf563.zip |
Merge branch 'nd/per-worktree-ref-iteration'
The code to traverse objects for reachability, used to decide what
objects are unreferenced and expendable, have been taught to also
consider per-worktree refs of other worktrees as starting points to
prevent data loss.
* nd/per-worktree-ref-iteration:
git-worktree.txt: correct linkgit command name
reflog expire: cover reflog from all worktrees
fsck: check HEAD and reflog from other worktrees
fsck: move fsck_head_link() to get_default_heads() to avoid some globals
revision.c: better error reporting on ref from different worktrees
revision.c: correct a parameter name
refs: new ref types to make per-worktree refs visible to all worktrees
Add a place for (not) sharing stuff between worktrees
refs.c: indent with tabs, not spaces
Diffstat (limited to 'worktree.h')
-rw-r--r-- | worktree.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h index 55d449b6a9..9e3b0b7b6f 100644 --- a/worktree.h +++ b/worktree.h @@ -108,4 +108,28 @@ extern const char *worktree_git_path(const struct worktree *wt, const char *fmt, ...) __attribute__((format (printf, 2, 3))); +/* + * Parse a worktree ref (i.e. with prefix main-worktree/ or + * worktrees/) and return the position of the worktree's name and + * length (or NULL and zero if it's main worktree), and ref. + * + * All name, name_length and ref arguments could be NULL. + */ +int parse_worktree_ref(const char *worktree_ref, const char **name, + int *name_length, const char **ref); + +/* + * Return a refname suitable for access from the current ref store. + */ +void strbuf_worktree_ref(const struct worktree *wt, + struct strbuf *sb, + const char *refname); + +/* + * Return a refname suitable for access from the current ref + * store. The result will be destroyed at the next call. + */ +const char *worktree_ref(const struct worktree *wt, + const char *refname); + #endif |