Class: Git::Commands::Stash::Pop Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/stash/pop.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-stash/2.53.0

Apply stashed changes and remove from stash list

Like Apply, but removes the stash from the stash list after applying, unless there are conflicts.

Examples:

Pop the latest stash

Git::Commands::Stash::Pop.new(execution_context).call

Pop a specific stash

Git::Commands::Stash::Pop.new(execution_context).call('stash@\\{2}')

Pop and restore index state

Git::Commands::Stash::Pop.new(execution_context).call(index: true)

Pop quietly

Git::Commands::Stash::Pop.new(execution_context).call(quiet: true)

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 #call(stash, **options) ⇒ Git::CommandLineResult

Pop stashed changes

Overloads:

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

    Pop the latest stash

    Parameters:

    • options (Hash)

      command options

    Options Hash (**options):

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

      restore the index state as well

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

      suppress informational messages

      Alias: :q

  • #call(stash, **options) ⇒ Git::CommandLineResult

    Pop a specific stash

    Parameters:

    • stash (String)

      stash reference (e.g., 'stash@{0}', '0')

    • options (Hash)

      command options

    Options Hash (**options):

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

      restore the index state as well

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

      suppress informational messages

      Alias: :q

Returns:

Raises:



# File 'lib/git/commands/stash/pop.rb', line 42