]> git.ipfire.org Git - thirdparty/git.git/commit
branch: use get_worktrees() in copy_or_rename_branch()
authorRubén Justo <rjusto@gmail.com>
Sun, 26 Mar 2023 22:33:09 +0000 (00:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Mar 2023 16:40:14 +0000 (09:40 -0700)
commitd7f4ca61b51da5655df09277309380794ba1bd19
tree72d51b40a39ce4155d18ed6f30ff75a0984632f5
parent2e8af499ff6e166a5f54f18cf3d1fa8f5d9bde38
branch: use get_worktrees() in copy_or_rename_branch()

Obtaining the list of worktrees, using get_worktrees(), is not a
lightweight operation, because it involves reading from disk.

Let's stop calling get_worktrees() in reject_rebase_or_bisect_branch()
and in replace_each_worktree_head_symref().  Make them receive the list
of worktrees from their only caller, copy_or_rename_branch().

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c