class Git::Commands::Worktree::ManagementBase

Shared base class for worktree management subcommands

Overrides the β€˜env` method from {Git::Commands::Base} to unconditionally unset `GIT_INDEX_FILE` in the subprocess environment. Git worktrees maintain their own index files; passing a `GIT_INDEX_FILE` override when running management commands causes silent corruption of both the main worktree and linked worktree indexes.

All worktree management subcommands ({Add}, {Lock}, {Move}, {Prune}, {Remove}, {Repair}, {Unlock}) inherit from this class. The read-only {List} subcommand uses {Git::Commands::Base} directly.

@example Defining a new worktree management subcommand

class Archive < Git::Commands::Worktree::ManagementBase
  arguments do
    literal 'worktree'
    literal 'archive'
    operand :path, required: true
  end
end

@see Git::Commands::Base

@see Git::Commands::Worktree

@api private