]> git.ipfire.org Git - thirdparty/git.git/commit
worktree: fix worktree add race
authorMichal Suchanek <msuchanek@suse.de>
Wed, 20 Feb 2019 16:16:48 +0000 (17:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Mar 2019 06:56:11 +0000 (15:56 +0900)
commit7af01f23678dbaeed37773e37737f2ef3db1cb49
treea2f1c5b36ad282814b077e8e04009e54e1ad800a
parent36eb1cb9cfe327583128a4b0abdf9516c2ca815b
worktree: fix worktree add race

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 <msuchanek@suse.de>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c