]> git.ipfire.org Git - thirdparty/git.git/blobdiff - worktree.h
submodules: fix of regression on fetching of non-init subsub-repo
[thirdparty/git.git] / worktree.h
index 516744c433f1e627abe85a347d72e6516f98c171..f38e6fd5a224fbe891f924df6b60a613b0b91638 100644 (file)
@@ -89,6 +89,29 @@ int validate_worktree(const struct worktree *wt,
 void update_worktree_location(struct worktree *wt,
                              const char *path_);
 
+typedef void (* worktree_repair_fn)(int iserr, const char *path,
+                                   const char *msg, void *cb_data);
+
+/*
+ * Visit each registered linked worktree and repair corruptions. For each
+ * repair made or error encountered while attempting a repair, the callback
+ * function, if non-NULL, is called with the path of the worktree and a
+ * description of the repair or error, along with the callback user-data.
+ */
+void repair_worktrees(worktree_repair_fn, void *cb_data);
+
+/*
+ * Repair administrative files corresponding to the worktree at the given path.
+ * The worktree's .git file pointing at the repository must be intact for the
+ * repair to succeed. Useful for re-associating an orphaned worktree with the
+ * repository if the worktree has been moved manually (without using "git
+ * worktree move"). For each repair made or error encountered while attempting
+ * a repair, the callback function, if non-NULL, is called with the path of the
+ * worktree and a description of the repair or error, along with the callback
+ * user-data.
+ */
+void repair_worktree_at_path(const char *, worktree_repair_fn, void *cb_data);
+
 /*
  * Free up the memory for worktree(s)
  */
@@ -136,11 +159,4 @@ 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