diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-05-15 23:59:02 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-15 23:59:03 +0300 |
commit | d3f2e4ab13f54ec3de1ac752e41d30847974c140 (patch) | |
tree | ef572432380f00901850fa6032314ad83e2b0b60 /branch.c | |
parent | 5bc069e383539824fd3a0d897100d44bbe1f8a24 (diff) | |
parent | 3521c6321350cf1432f4772efa09db8bec0aa331 (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.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -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; -} |