MCPcopy
hub / github.com/git-lfs/git-lfs / UpdateRef

Function UpdateRef

git/git.go:547–555  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

545// reflog entry, if a "reason" was provided). It returns an error if any were
546// encountered.
547func 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

Callers 1

migrateImportCommandFunction · 0.92

Calls 2

gitNoLFSSimpleFunction · 0.85
RefspecMethod · 0.80

Tested by

no test coverage detected