code: func UpdateRefIn(wd string, ref *Ref, to []byte, reason string) error {
  	args := []string{"update-ref", ref.Refspec(), hex.EncodeToString(to)}
  	if len(reason) > 0 {
  		args = append(args, "-m", reason)
  	}
  
  	cmd := gitNoLFS(args...)
  	cmd.Dir = wd
  
  	return cmd.Run()
  }
docs: // UpdateRef moves the given ref to a new sha with a given reason (and creates a
  // reflog entry, if a "reason" was provided). It operates within the given
  // working directory "wd". It returns an error if any were encountered.