Skip to content

Commit

Permalink
.ci/retrofit-worktree.sh: Prune old worktree if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed May 13, 2024
1 parent fe470b5 commit 4c076bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .ci/retrofit-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ git tag -f new
# The changed files now show up as uncommitted changes.
# The final "git add -N" makes sure that files that were added in "new" do not show
# as untracked files, which would be removed by "git clean -fx".
if [ -L $WORKTREE_NAME ]; then
rm -f $WORKTREE_NAME
git worktree prune --verbose
fi
git worktree add --detach $WORKTREE_NAME
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
Expand Down

0 comments on commit 4c076bb

Please sign in to comment.