removeWorktree function

Future<bool> removeWorktree({
  1. String? dir,
  2. required String path,
  3. bool force = false,
})

Remove a git worktree.

Implementation

Future<bool> removeWorktree({
  String? dir,
  required String path,
  bool force = false,
}) async {
  final result = await runGit([
    'worktree',
    'remove',
    if (force) '--force',
    path,
  ], workingDirectory: dir);
  return result.success;
}