createWorktree function
Create a git worktree.
Implementation
Future<String?> createWorktree({
String? dir,
required String path,
required String branch,
bool createBranch = true,
}) async {
final args = ['worktree', 'add'];
if (createBranch) args.add('-b');
args.addAll([path, if (!createBranch) branch]);
final result = await runGit(args, workingDirectory: dir);
return result.success ? path : null;
}