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:
authorJunio C Hamano <gitster@pobox.com>2023-05-15 23:59:02 +0300
committerJunio C Hamano <gitster@pobox.com>2023-05-15 23:59:03 +0300
commitd3f2e4ab13f54ec3de1ac752e41d30847974c140 (patch)
treeef572432380f00901850fa6032314ad83e2b0b60 /branch.c
parent5bc069e383539824fd3a0d897100d44bbe1f8a24 (diff)
parent3521c6321350cf1432f4772efa09db8bec0aa331 (diff)
Merge branch 'rj/branch-unborn-in-other-worktrees'
Error messages given when working on an unborn branch that is checked out in another worktree have been improved. * rj/branch-unborn-in-other-worktrees: branch: avoid unnecessary worktrees traversals branch: rename orphan branches in any worktree branch: description for orphan branch errors branch: use get_worktrees() in copy_or_rename_branch() branch: test for failures while renaming branches
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/branch.c b/branch.c
index 9415ee3f34..ba3914adf5 100644
--- a/branch.c
+++ b/branch.c
@@ -840,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;
-}