Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2023-02-25 17:21:51 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-26 00:05:23 +0300
commit662078caacd450f93faa72e0e7d8580c42621415 (patch)
tree08463245b6875b087d6feb08325928a523d2114a /worktree.h
parent56c8fb1e95377900ec9d53c07886022af0a5d3c2 (diff)
worktree: introduce is_shared_symref()
Add a new function, is_shared_symref(), which contains the heart of find_shared_symref(). Refactor find_shared_symref() to use the new function is_shared_symref(). Soon, we will use is_shared_symref() to search for symref beyond the first worktree that matches. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index 9dcea6fc8c..7889c4761d 100644
--- a/worktree.h
+++ b/worktree.h
@@ -150,6 +150,12 @@ const struct worktree *find_shared_symref(struct worktree **worktrees,
const char *target);
/*
+ * Returns true if a symref points to a ref in a worktree.
+ */
+int is_shared_symref(const struct worktree *wt,
+ const char *symref, const char *target);
+
+/*
* Similar to head_ref() for all HEADs _except_ one from the current
* worktree, which is covered by head_ref().
*/