Run `git worktree prune` periodically
From https://gitlab.com/gitlab-org/gitlab-ce/issues/56135, Git 2.20 enforces new behavior via https://github.com/git/git/commit/e19831c94f91fd410fe001c0372b9c88b40d335b:
For safety, "git worktree add " will refuse to add a new worktree at if is already associated with a worktree entry, even if is missing (for instance, has been deleted or resides on non-mounted removable media or network share). The typical way to re-create a worktree at in such a situation is either to prune all "broken" entries ("git worktree prune") or to selectively remove the worktree entry manually ("git worktree remove ").
Right now our Cleanup
RPC only removes the stale worktrees/
paths, but the Git metadata still remains there. We should just run git worktree prune
after removing these paths to ensure the data is consistent.
I think this is a blocker for shipping Git 2.20 with Omnibus.