aboutsummaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-03-26 16:26:09 +0900
committerJunio C Hamano <gitster@pobox.com>2025-03-26 16:26:10 +0900
commitde35b7b3ffb6e642b47f748eb38e31182377fb0a (patch)
tree02bd656487b73596cda06df6415dd7fb98402a67 /worktree.h
parentf50df872a45c4a1010dc5378055b1be0e844add1 (diff)
parentc1cf918d3adbe832fdaf278a23151502be255bb2 (diff)
downloadgit-de35b7b3ffb6e642b47f748eb38e31182377fb0a.tar.xz
Merge branch 'sj/ref-consistency-checks-more'
"git fsck" becomes more careful when checking the refs. * sj/ref-consistency-checks-more: builtin/fsck: add `git refs verify` child process packed-backend: check whether the "packed-refs" is sorted packed-backend: add "packed-refs" entry consistency check packed-backend: check whether the refname contains NUL characters packed-backend: add "packed-refs" header consistency check packed-backend: check if header starts with "# pack-refs with: " packed-backend: check whether the "packed-refs" is regular file builtin/refs: get worktrees without reading head information t0602: use subshell to ensure working directory unchanged
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index 16368588a0..e4bcccdc0a 100644
--- a/worktree.h
+++ b/worktree.h
@@ -31,6 +31,14 @@ struct worktree {
struct worktree **get_worktrees(void);
/*
+ * Like `get_worktrees`, but does not read HEAD. Skip reading HEAD allows to
+ * get the worktree without worrying about failures pertaining to parsing
+ * the HEAD ref. This is useful in contexts where it is assumed that the
+ * refdb may not be in a consistent state.
+ */
+struct worktree **get_worktrees_without_reading_head(void);
+
+/*
* Returns 1 if linked worktrees exist, 0 otherwise.
*/
int submodule_uses_worktrees(const char *path);