Class: Git::Commands::Am::ShowCurrentPatch Private

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

Implements the git am --show-current-patch command

Shows the message currently being applied when git am has stopped due to conflicts.

Examples:

Show the current patch

show_cmd = Git::Commands::Am::ShowCurrentPatch.new(execution_context)
show_cmd.call

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(*, show_current_patch: true, **options) ⇒ Git::CommandLineResult

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

Execute the git am --show-current-patch command

Parameters:

  • show_current_patch (true, String) (defaults to: true)

    patch format selector

    Pass true (default) to emit --show-current-patch (git defaults to raw format); pass 'diff' to emit --show-current-patch=diff (diff portion only) or 'raw' for --show-current-patch=raw (full raw email). Passing false or nil raises ArgumentError.

  • options (Hash)

    command options

Returns:

Raises:

  • (ArgumentError)

    if show_current_patch is false or nil

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



53
54
55
56
57
58
59
60
# File 'lib/git/commands/am/show_current_patch.rb', line 53

def call(*, show_current_patch: true, **)
  unless show_current_patch
    raise ArgumentError,
          ":show_current_patch must be true or a non-empty String, got #{show_current_patch.inspect}"
  end

  super
end