From fa099d23227f88b5a1cd79c646551130d9b36e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 24 Apr 2017 17:01:23 +0700 Subject: worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manual parsing code is replaced with a call to refs_resolve_ref_unsafe(). The manual parsing code must die because only refs/files-backend.c should do that. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- branch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'branch.c') diff --git a/branch.c b/branch.c index 5c12036b0..0b949b7fb 100644 --- a/branch.c +++ b/branch.c @@ -355,7 +355,8 @@ int replace_each_worktree_head_symref(const char *oldref, const char *newref, for (i = 0; worktrees[i]; i++) { if (worktrees[i]->is_detached) continue; - if (strcmp(oldref, worktrees[i]->head_ref)) + if (worktrees[i]->head_ref && + strcmp(oldref, worktrees[i]->head_ref)) continue; if (set_worktree_head_symref(get_worktree_git_dir(worktrees[i]), -- cgit v1.2.1