Class: Git::Commands::Worktree::Prune Private

Inherits:
ManagementBase show all
Defined in:
lib/git/commands/worktree/prune.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.

Note:

arguments block audited against https://git-scm.com/docs/git-worktree/2.54.0

Prunes stale worktree administrative files

Examples:

Prune stale worktree info

Git::Commands::Worktree::Prune.new(execution_context).call

Dry-run to see what would be pruned

Git::Commands::Worktree::Prune.new(execution_context).call(dry_run: true)

Prune entries older than 2 weeks

Git::Commands::Worktree::Prune.new(execution_context).call(expire: '2.weeks.ago')

See Also:

Instance Method Summary collapse

Methods inherited from Base

allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation

Constructor Details

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

Instance Method Details

#call(**options) ⇒ Git::CommandLineResult

Prune stale worktree administrative files

Parameters:

  • options (Hash)

    command options

Options Hash (**options):

  • :dry_run (Boolean, nil) — default: nil

    report what would be removed without removing anything

    Alias: :n

  • :verbose (Boolean, nil) — default: nil

    report all removals

    Alias: :v

  • :expire (String) — default: nil

    only prune entries older than this time expression

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/worktree/prune.rb', line 37