gitpb/update.go

25 lines
436 B
Go

package gitpb
// this is becoming a standard format
// todo: autogenerate this from the .proto file?
// Update version and timestamp.
// returns ok (ok == true if not found)
func (r *Refs) Update(newP *Ref) bool {
lock.Lock()
defer lock.Unlock()
var found *Ref
for _, p := range r.Refs {
if p.RefName == newP.RefName {
found = p
}
}
if found == nil {
// r.Append(newP) // update here?
return true
}
return true
}