class Git::Commands::UpdateRef::Batch

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 {UpdateRef::Update} and {UpdateRef::Delete} commands.

Instructions are newline-delimited by default; pass ‘z: true` to switch to NUL-delimited format. See the {git-scm.com/docs/git-update-ref#_stdin_mode git-update-ref} documentation for the full instruction grammar.

@example Atomically update two refs

cmd = Git::Commands::UpdateRef::Batch.new(execution_context)
cmd.call(
  'update refs/heads/main newsha oldsha',
  'delete refs/heads/old-branch'
)

@example NUL-delimited instructions

cmd = Git::Commands::UpdateRef::Batch.new(execution_context)
cmd.call("update refs/heads/main\0newsha\0oldsha", z: true)

@example Non-atomic batch (independent failures)

cmd = Git::Commands::UpdateRef::Batch.new(execution_context)
cmd.call(
  'update refs/heads/main newsha oldsha',
  'delete refs/heads/old-branch',
  batch_updates: true
)

@note ‘arguments` block audited against git-scm.com/docs/git-update-ref/2.53.0

@see Git::Commands::UpdateRef

@see git-scm.com/docs/git-update-ref git-update-ref documentation

@api private