]> git.ipfire.org Git - thirdparty/git.git/blobdiff - branch.c
git maintenance: avoid console window in scheduled tasks on Windows
[thirdparty/git.git] / branch.c
index 99a0e7889e42226ce8230e8d0472268bcfec7fe5..ba3914adf5b7bfdccd5b76774e1287bf52d1e749 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -1,13 +1,15 @@
 #include "git-compat-util.h"
-#include "cache.h"
+#include "advice.h"
 #include "config.h"
 #include "branch.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
 #include "refs.h"
 #include "refspec.h"
 #include "remote.h"
+#include "repository.h"
 #include "sequencer.h"
 #include "commit.h"
 #include "worktree.h"
@@ -838,30 +840,3 @@ void die_if_checked_out(const char *branch, int ignore_current_worktree)
 
        free_worktrees(worktrees);
 }
-
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
-                                     const char *logmsg)
-{
-       int ret = 0;
-       struct worktree **worktrees = get_worktrees();
-       int i;
-
-       for (i = 0; worktrees[i]; i++) {
-               struct ref_store *refs;
-
-               if (worktrees[i]->is_detached)
-                       continue;
-               if (!worktrees[i]->head_ref)
-                       continue;
-               if (strcmp(oldref, worktrees[i]->head_ref))
-                       continue;
-
-               refs = get_worktree_ref_store(worktrees[i]);
-               if (refs_create_symref(refs, "HEAD", newref, logmsg))
-                       ret = error(_("HEAD of working tree %s is not updated"),
-                                   worktrees[i]->path);
-       }
-
-       free_worktrees(worktrees);
-       return ret;
-}