Class: Git::Commands::Worktree::ManagementBase Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/worktree/management_base.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Shared base class for worktree management subcommands

Overrides the env method from 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 Base directly.

Examples:

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 Also:

Direct Known Subclasses

Add, Lock, Move, Prune, Remove, Repair, Unlock

Method Summary

Methods inherited from Base

allow_exit_status, arguments, #call, #initialize, requires_git_version, skip_version_validation

Constructor Details

This class inherits a constructor from Git::Commands::Base