mirror of
https://cgit.krebsco.de/krops
synced 2024-12-23 02:09:51 +01:00
populate git: remove non-worktree target
This commit is contained in:
parent
13ae434b14
commit
824aa36b2a
1 changed files with 5 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue