UpdateRef moves the given ref to a new sha with a given reason (and creates a reflog entry, if a "reason" was provided). It returns an error if any were encountered.
(ref *Ref, to []byte, reason string)
| 545 | // reflog entry, if a "reason" was provided). It returns an error if any were |
| 546 | // encountered. |
| 547 | func UpdateRef(ref *Ref, to []byte, reason string) error { |
| 548 | args := []string{"update-ref", ref.Refspec(), hex.EncodeToString(to)} |
| 549 | if len(reason) > 0 { |
| 550 | args = append(args, "-m", reason) |
| 551 | } |
| 552 | |
| 553 | _, err := gitNoLFSSimple(args...) |
| 554 | return err |
| 555 | } |
| 556 | |
| 557 | // UpdateRefsFromStdinInDir initializes a "git update-ref" command which will |
| 558 | // read a series of reference update instructions from standard input and |
no test coverage detected