1
0
mirror of https://cgit.krebsco.de/krops synced 2024-06-07 08:23:37 +02:00

populate git: remove non-worktree target

This commit is contained in:
tv 2022-02-12 10:06:34 +01:00
parent 13ae434b14
commit 824aa36b2a

View File

@ -63,6 +63,11 @@ let
pop.git = target: source: runShell target /* sh */ ''
set -efu
# Remove target path if it doesn't look like a git worktree.
# This can happen e.g. when it had a different type earlier.
if ! test -e ${quote target.path}/.git; then
rm -fR ${quote target.path}
fi
if ! test -e ${quote target.path}; then
${if source.shallow then /* sh */ ''
git init ${quote target.path}