From 14ace5b77b493506a1f8ffde96a2f49cc7bc4db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 22 Apr 2016 20:01:36 +0700 Subject: branch: do not rename a branch under bisect or rebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The branch name in that case could be saved in rebase's head_name or bisect's BISECT_START files. Ideally we should try to update them as well. But it's trickier (*). Let's play safe and see if the user complains about inconveniences before doing that. (*) If we do it, bisect and rebase need to provide an API to rename branches. We can't do it in worktree.c or builtin/branch.c because when other people change rebase/bisect code, they may not be aware of this code and accidentally break it (e.g. rename the branch file, or refer to the branch in new files). It's a lot more work. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- worktree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'worktree.c') diff --git a/worktree.c b/worktree.c index aab4b9552..4817d6005 100644 --- a/worktree.c +++ b/worktree.c @@ -216,8 +216,8 @@ const char *get_worktree_git_dir(const struct worktree *wt) return git_common_path("worktrees/%s", wt->id); } -static int is_worktree_being_rebased(const struct worktree *wt, - const char *target) +int is_worktree_being_rebased(const struct worktree *wt, + const char *target) { struct wt_status_state state; int found_rebase; @@ -234,8 +234,8 @@ static int is_worktree_being_rebased(const struct worktree *wt, return found_rebase; } -static int is_worktree_being_bisected(const struct worktree *wt, - const char *target) +int is_worktree_being_bisected(const struct worktree *wt, + const char *target) { struct wt_status_state state; int found_rebase; -- cgit v1.2.1