worktree: reorder an if statement