diff options
author | Michael Muré <batolettre@gmail.com> | 2020-09-16 16:22:02 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-10-04 20:39:10 +0200 |
commit | ca720f165cb286d4372ad48595e532a2423f2f07 (patch) | |
tree | 6e1496a1a6603abbd473cc0060a5acebc763a68b /identity/interface.go | |
parent | d56ce3d5d9f5ef74201a8ee7c25be4820d435b47 (diff) | |
download | git-bug-ca720f165cb286d4372ad48595e532a2423f2f07.tar.gz git-bug-ca720f165cb286d4372ad48595e532a2423f2f07.zip |
cache,bug,identity: structural change
- bug doesn't commit identities anymore, only make sure they are commit
- cache use an IdentityResolver to load bugs with identities from the cache (deps injection)
- IdentityCache now are identity.Interface
Diffstat (limited to 'identity/interface.go')
-rw-r--r-- | identity/interface.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/identity/interface.go b/identity/interface.go index bbb94be7..a7174962 100644 --- a/identity/interface.go +++ b/identity/interface.go @@ -2,14 +2,12 @@ package identity import ( "github.com/MichaelMure/git-bug/entity" - "github.com/MichaelMure/git-bug/repository" "github.com/MichaelMure/git-bug/util/lamport" "github.com/MichaelMure/git-bug/util/timestamp" ) type Interface interface { - // Id return the Identity identifier - Id() entity.Id + entity.Interface // Name return the last version of the name // Can be empty. @@ -45,14 +43,6 @@ type Interface interface { // Validate check if the Identity data is valid Validate() error - // Write the identity into the Repository. In particular, this ensure that - // the Id is properly set. - Commit(repo repository.ClockedRepo) error - - // If needed, write the identity into the Repository. In particular, this - // ensure that the Id is properly set. - CommitAsNeeded(repo repository.ClockedRepo) error - // IsProtected return true if the chain of git commits started to be signed. // If that's the case, only signed commit with a valid key for this identity can be added. IsProtected() bool @@ -62,4 +52,7 @@ type Interface interface { // LastModification return the timestamp at which the last version of the identity became valid. LastModification() timestamp.Timestamp + + // Indicate that the in-memory state changed and need to be commit in the repository + NeedCommit() bool } |