Use a sparse checkout for rebase operations
Problem to solve
Git worktree operations (like rebasing) are slow because we checkout everything. @chriscool pointed out a full checkout is not required, and a sparse checkout could be used.
From the git worktree docs:
core.sparseCheckout is recommended per working tree, unless you are sure you always use sparse checkout for all working trees.
This config option might be set at run time, using a
We can observe on GitLab.com that the p95 and p99 timing of
UserRebaseConfirmable frequently exceeds 10 seconds, and regularly approaches a minute.
UserRebaseConfirmable using Go (it is currently inside