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

Method CommitAsNeeded

entity/dag/entity.go:438–443  ·  view source on GitHub ↗

CommitAsNeeded execute a Commit only if necessary. This function is useful to avoid getting an error if the Entity is already in sync with the repository.

(repo repository.ClockedRepo)

Source from the content-addressed store, hash-verified

436// CommitAsNeeded execute a Commit only if necessary. This function is useful to avoid getting an error if the Entity
437// is already in sync with the repository.
438func (e *Entity) CommitAsNeeded(repo repository.ClockedRepo) error {
439 if e.NeedCommit() {
440 return e.Commit(repo)
441 }
442 return nil
443}
444
445// Commit write the appended operations in the repository
446func (e *Entity) Commit(repo repository.ClockedRepo) error {

Callers

nothing calls this directly

Calls 2

NeedCommitMethod · 0.95
CommitMethod · 0.95

Tested by

no test coverage detected