module Git::Commands::UpdateRef

Commands for safely updating ref values via β€˜git update-ref`

This module contains command classes split by invocation mode:

@example Update a branch ref to a new commit SHA

cmd = Git::Commands::UpdateRef::Update.new(lib)
cmd.call('refs/heads/main', 'abc1234')

@example Delete a ref

cmd = Git::Commands::UpdateRef::Delete.new(lib)
cmd.call('refs/heads/old-branch')

@example Atomically update multiple refs via stdin

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

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

@api private