diff options
Diffstat (limited to 'identity')
-rw-r--r-- | identity/identity.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/identity/identity.go b/identity/identity.go index ed8e39e0..cd47c1b7 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -261,6 +261,16 @@ func GetUserIdentity(repo repository.Repo) (*Identity, error) { return i, nil } +// IsUserIdentitySet say if the user has set his identity +func IsUserIdentitySet(repo repository.Repo) (bool, error) { + configs, err := repo.LocalConfig().ReadAll(identityConfigKey) + if err != nil { + return false, err + } + + return len(configs) == 1, nil +} + func (i *Identity) AddVersion(version *Version) { i.versions = append(i.versions, version) } |