Skip to content

Properly clean up worktrees after commit operations

Stan Hu requested to merge sh-worktree-cleanup into master

Removing the worktree directory leaves a worktree in a disconnected state, since the Git metadata is still present. This can be cleaned up via git worktree prune, but we shouldn't have to rely on that.

Leaving a disconnected worktree can cause unintended problems. For example, git rev-list <SHA> --not --all may erroneously return an empty list if the worktree branch contains a reference to that commit.

Closes #1593 (closed)

Edited by GitLab Release Tools Bot

Merge request reports