From be6db82174a7ad396d4ab6d2bdd55aa8de8d19e8 Mon Sep 17 00:00:00 2001 From: LaszloP <7979773+lpusok@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:24:48 +0100 Subject: [PATCH] Added UpdateRef --- command/git/commands.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/command/git/commands.go b/command/git/commands.go index 8595a41..43a1604 100644 --- a/command/git/commands.go +++ b/command/git/commands.go @@ -47,7 +47,7 @@ func (g *Git) Fetch(opts ...string) *command.Model { return g.command(args...) } -// Checkout switchs branches or restore working tree files. +// Checkout switches branches or restore working tree files. // Arg can be a commit hash, a branch or a tag. func (g *Git) Checkout(arg string) *command.Model { return g.command("checkout", arg) @@ -173,3 +173,11 @@ func (g *Git) SparseCheckoutSet(opts ...string) *command.Model { args = append(args, opts...) return g.command(args...) } + +// UpdateRef updates the object name stored in a ref safely. +// With -d flag, it deletes the named . +func (g *Git) UpdateRef(opts ...string) *command.Model { + args := []string{"update-ref"} + args = append(args, opts...) + return g.command(args...) +}