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...) +}