MCPcopy Create free account
hub / github.com/git-bug/git-bug / Apply

Method Apply

entity/dag/example_test.go:133–141  ·  view source on GitHub ↗

Apply is the function that makes changes on the snapshot

(snapshot *Snapshot)

Source from the content-addressed store, hash-verified

131
132// Apply is the function that makes changes on the snapshot
133func (aa *AddAdministrator) Apply(snapshot *Snapshot) {
134 // check that we are allowed to change the config ... or if there is no admin yet
135 if !snapshot.HasAdministrator(aa.Author()) && len(snapshot.Administrator) != 0 {
136 return
137 }
138 for _, toAdd := range aa.ToAdd {
139 snapshot.Administrator[toAdd] = struct{}{}
140 }
141}
142
143// RemoveAdministrator is an operation to remove an administrator from the set
144type RemoveAdministrator struct {

Callers

nothing calls this directly

Calls 2

HasAdministratorMethod · 0.80
AuthorMethod · 0.65

Tested by

no test coverage detected