diff options
author | Karel Kočí <cynerd@email.cz> | 2018-12-27 15:10:14 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-12-27 15:10:14 +0100 |
commit | f4c569bb0c7c65e5e2f26e11214cc194590049b0 (patch) | |
tree | b05da5a1552c45aa62df3d5c6aef98ff9b7a041a | |
parent | b4ca089ce19b82623cddbb367df1e42c7993f774 (diff) | |
download | laminar-cnf-f4c569bb0c7c65e5e2f26e11214cc194590049b0.tar.gz laminar-cnf-f4c569bb0c7c65e5e2f26e11214cc194590049b0.tar.bz2 laminar-cnf-f4c569bb0c7c65e5e2f26e11214cc194590049b0.zip |
utils: fix problem with old missing worktrees
New version of git fails if there is some work tree that is no longer
accessible. I have no idea if this is a bug or not (I expect it to be)
but true is that until now all previously used work trees were preserved
which means that we have a lot of old work trees in bare repository.
This changes that and should ensure that work tree is created even if
some other work tree is missing.
-rw-r--r-- | scripts/utils | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/utils b/scripts/utils index 8837c3c..1c56d1d 100644 --- a/scripts/utils +++ b/scripts/utils @@ -39,7 +39,8 @@ _git_fetch() { local BRANCH="$3" [ -n "$BRANCH" ] || BRANCH=master git_fetch_bare "$1" "$4/$2" - git --git-dir="$4/$2" --bare worktree add --detach "$2" "$BRANCH" + git --git-dir="$4/$2" --bare worktree prune # remove old work trees + git --git-dir="$4/$2" --bare worktree add --force --detach "$2" "$BRANCH" } # Fetch git repository with mirror |