Skip to content

Commit

Permalink
Added UpdateRef (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpusok authored Feb 21, 2024
1 parent 3ae412a commit a262e05
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion command/git/commands.go
Original file line number Diff line number Diff line change
@@ -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 <ref>.
func (g *Git) UpdateRef(opts ...string) *command.Model {
args := []string{"update-ref"}
args = append(args, opts...)
return g.command(args...)
}

0 comments on commit a262e05

Please sign in to comment.