Git runs a stat loop to find a worktree name that's available and then does
mkdir on the found name. Turn it to mkdir loop to avoid another invocation of
worktree add finding the same free name and creating the directory first.
Signed-off-by: Michal Suchanek
---
v2:
- simplify loop exit condition
On Fri, Feb 15, 2019 at 1:59 PM Junio C Hamano wrote:
> Michal Suchanek writes:
> > Git runs a stat loop to find a worktree name that's available and then does
> > mkdir on the found name. Turn it to mkdir loop to avoid another invocation
> > of
> > worktree add finding the same free name and cr
On Fri, 15 Feb 2019 10:59:33 -0800
Junio C Hamano wrote:
> Michal Suchanek writes:
>
> > Git runs a stat loop to find a worktree name that's available and then does
> > mkdir on the found name. Turn it to mkdir loop to avoid another invocation
> > of
> > worktree add finding the same free name
Michal Suchanek writes:
> Git runs a stat loop to find a worktree name that's available and then does
> mkdir on the found name. Turn it to mkdir loop to avoid another invocation of
> worktree add finding the same free name and creating the directory first.
Yeah, relying on the atomicity of mkdi
Git runs a stat loop to find a worktree name that's available and then does
mkdir on the found name. Turn it to mkdir loop to avoid another invocation of
worktree add finding the same free name and creating the directory first.
Signed-off-by: Michal Suchanek
---
builtin/worktree.c | 11 ++---
5 matches
Mail list logo