Class: Git::Commands::UpdateRef::Batch Private
- Defined in:
- lib/git/commands/update_ref/batch.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.
arguments block audited against https://git-scm.com/docs/git-update-ref/2.53.0
Performs batch ref updates via the git update-ref --stdin protocol
Reads update/create/delete/verify instructions from stdin. By default
all modifications are applied atomically — either all succeed or none do.
Pass batch_updates: true to switch to non-atomic mode, where each
instruction is applied independently and individual failures are reported
without aborting the remaining updates (requires git 2.47+).
This is the batch counterpart to the single-ref Update and Delete commands.
Instructions are newline-delimited by default; pass z: true to switch
to NUL-delimited format. See the
git-update-ref
documentation for the full instruction grammar.
Instance Method Summary collapse
-
#call(*instructions, **options) ⇒ Git::CommandLineResult
private
Execute
git update-ref --stdinwith instructions fed via stdin.
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(*instructions, **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.
119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/git/commands/update_ref/batch.rb', line 119 def call(*, **) bound = args_definition.bind(*, **) validate_version! with_stdin(build_stdin(bound)) do |reader| result = @execution_context.command_capturing( *bound, in: reader, **bound., raise_on_failure: false ) validate_exit_status!(result) result end end |