summaryrefslogtreecommitdiff
path: root/branch.h
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2023-03-26 22:33:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-03-27 16:40:14 (GMT)
commit2e8af499ff6e166a5f54f18cf3d1fa8f5d9bde38 (patch)
treeb0c12fdd47381043ee46c5e6e5b97d78b2094e96 /branch.h
parent73876f4861cd3d187a4682290ab75c9dccadbc56 (diff)
downloadgit-2e8af499ff6e166a5f54f18cf3d1fa8f5d9bde38.zip
git-2e8af499ff6e166a5f54f18cf3d1fa8f5d9bde38.tar.gz
git-2e8af499ff6e166a5f54f18cf3d1fa8f5d9bde38.tar.bz2
branch: test for failures while renaming branches
When we introduced replace_each_worktree_head_symref() in 70999e9cec (branch -m: update all per-worktree HEADs, 2016-03-27), we implemented a best effort approach. If we are asked to rename a branch that is simultaneously checked out in multiple worktrees, we try to update all of those worktrees. If we fail updating any of them, we die() as a signal that something has gone wrong. However, at this point, the branch ref has already been renamed and also updated the HEADs of the successfully updated worktrees. Despite returning an error, we do not try to rollback those changes. Let's add a test to notice if we change this behavior in the future. In next commits we will change replace_each_worktree_head_symref() to work more closely with its only caller, copy_or_rename_branch(). Let's move the former closer to its caller, to facilitate those changes. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.h')
-rw-r--r--branch.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/branch.h b/branch.h
index ef56103..30c01ae 100644
--- a/branch.h
+++ b/branch.h
@@ -155,12 +155,4 @@ int read_branch_desc(struct strbuf *, const char *branch_name);
*/
void die_if_checked_out(const char *branch, int ignore_current_worktree);
-/*
- * Update all per-worktree HEADs pointing at the old ref to point the new ref.
- * This will be used when renaming a branch. Returns 0 if successful, non-zero
- * otherwise.
- */
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
- const char *logmsg);
-
#endif