worktree: prepare for more checks of whether path can become worktree
commit45059e6468ab5710748c8827d5bf1f4c7c69d6d1
authorEric Sunshine <sunshine@sunshineco.com>
Tue, 28 Aug 2018 21:20:21 +0000 (28 17:20 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Aug 2018 16:28:02 +0000 (30 09:28 -0700)
treeaef9bf3305497bbe1f730bc42c0a4db86684b0f7
parent602aaed03f7f82323d88703d6fa2263a13c37907
worktree: prepare for more checks of whether path can become worktree

Certain conditions must be met for a path to be a valid candidate as the
location of a new worktree; for instance, the path must not exist or
must be an empty directory. Although the number of conditions is small,
new conditions will soon be added so factor out the existing checks into
a separate function to avoid further bloating add_worktree().

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c