Re: [PATCH 1/2] worktree: fix "add -B"

2016-02-15 Thread Duy Nguyen
On Tue, Feb 16, 2016 at 6:53 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Current code does not update "symref" when -B is used. This string >> contains the new HEAD. Because it's empty "git worktree add -B" fails at >> symbolic-ref step.

Re: [PATCH 1/2] worktree: fix "add -B"

2016-02-15 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Current code does not update "symref" when -B is used. This string > contains the new HEAD. Because it's empty "git worktree add -B" fails at > symbolic-ref step. > > Because branch creation is already done before calling add_worktree(), > -B is

[PATCH 1/2] worktree: fix "add -B"

2016-02-15 Thread Nguyễn Thái Ngọc Duy
Current code does not update "symref" when -B is used. This string contains the new HEAD. Because it's empty "git worktree add -B" fails at symbolic-ref step. Because branch creation is already done before calling add_worktree(), -B is equivalent to -b from add_worktree() point of view. We do not