module Git::Commands::UpdateRef
Commands for safely updating ref values via βgit update-ref`
This module contains command classes split by invocation mode:
-
{UpdateRef::Update} β set a ref to a new value (the default mode); also supports verifying the old value before updating
-
{UpdateRef::Delete} β delete a ref (β-d` flag); optionally verifies the current value before deleting
-
{UpdateRef::Batch} β read update/create/delete/verify instructions from stdin (ββstdin`); all modifications are applied atomically
@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