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
happnes git aborts failing to perform perfectly valid
command because unrelated worktree is not yet fully initialized.
Rather than testing if the file exists before reading it handle ENOENT
and ENOTDIR.
Signed-off-by: Michal Suchanek
---
v2:
- do not test file existence first, just read it and
...@mail.gmail.com/
Michal Suchanek (2):
worktree: fix worktree add race.
setup: don't fail if commondir reference is deleted.
builtin/worktree.c | 12 +++-
setup.c| 16 +++-
2 files changed, 18 insertions(+), 10 deletions(-)
--
2.20.1
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
When adding wotktrees git can die in get_common_dir_noenv while
examining existing worktrees because the commondir file does not exist.
Rather than testing if the file exists before reading it handle ENOENT.
Signed-off-by: Michal Suchanek
---
v2:
- do not test file existence first, just read it
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
When adding wotktrees git can die in get_common_dir_noenv while
examining existing worktrees because the commondir file does not exist.
Handle ENOENT so adding a worktree does not fail because of incompletely
set-up other worktree.
Signed-off-by: Michal Suchanek
---
setup.c | 33
7 matches
Mail list logo