listWorktrees function
List git worktrees.
Implementation
Future<List<String>> listWorktrees({String? dir}) async {
final result = await runGit([
'worktree',
'list',
'--porcelain',
], workingDirectory: dir);
if (!result.success) return [];
return result.output
.split('\n')
.where((l) => l.startsWith('worktree '))
.map((l) => l.substring(9))
.toList();
}