Skip to content

Commit a262e05

Browse files
authored
Added UpdateRef (#193)
1 parent 3ae412a commit a262e05

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

command/git/commands.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (g *Git) Fetch(opts ...string) *command.Model {
4747
return g.command(args...)
4848
}
4949

50-
// Checkout switchs branches or restore working tree files.
50+
// Checkout switches branches or restore working tree files.
5151
// Arg can be a commit hash, a branch or a tag.
5252
func (g *Git) Checkout(arg string) *command.Model {
5353
return g.command("checkout", arg)
@@ -173,3 +173,11 @@ func (g *Git) SparseCheckoutSet(opts ...string) *command.Model {
173173
args = append(args, opts...)
174174
return g.command(args...)
175175
}
176+
177+
// UpdateRef updates the object name stored in a ref safely.
178+
// With -d flag, it deletes the named <ref>.
179+
func (g *Git) UpdateRef(opts ...string) *command.Model {
180+
args := []string{"update-ref"}
181+
args = append(args, opts...)
182+
return g.command(args...)
183+
}

0 commit comments

Comments
 (0)