diff options
author | amine <hilalyamine@gmail.com> | 2019-11-01 22:01:21 +0100 |
---|---|---|
committer | amine <hilalyamine@gmail.com> | 2019-11-01 22:01:21 +0100 |
commit | 618f896f667b272c1272b1289c8ff3f3310c3168 (patch) | |
tree | 082d43b849c15c296dd5d8eb8d5229d8d0347e8e /identity/identity.go | |
parent | b85b2c57a73a6068fdc446866f79115315082997 (diff) | |
download | git-bug-618f896f667b272c1272b1289c8ff3f3310c3168.tar.gz |
cache: update RepoCache and identity to use new repository Config
Diffstat (limited to 'identity/identity.go')
-rw-r--r-- | identity/identity.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/identity/identity.go b/identity/identity.go index 765b77cd..b7d44a4b 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -220,7 +220,7 @@ func NewFromGitUser(repo repository.Repo) (*Identity, error) { // IsUserIdentitySet tell if the user identity is correctly set. func IsUserIdentitySet(repo repository.RepoCommon) (bool, error) { - configs, err := repo.ReadConfigs(identityConfigKey) + configs, err := repo.LocalConfig().ReadAll(identityConfigKey) if err != nil { return false, err } @@ -234,12 +234,12 @@ func IsUserIdentitySet(repo repository.RepoCommon) (bool, error) { // SetUserIdentity store the user identity's id in the git config func SetUserIdentity(repo repository.RepoCommon, identity *Identity) error { - return repo.StoreConfig(identityConfigKey, identity.Id().String()) + return repo.LocalConfig().StoreString(identityConfigKey, identity.Id().String()) } // GetUserIdentity read the current user identity, set with a git config entry func GetUserIdentity(repo repository.Repo) (*Identity, error) { - configs, err := repo.ReadConfigs(identityConfigKey) + configs, err := repo.LocalConfig().ReadAll(identityConfigKey) if err != nil { return nil, err } @@ -263,7 +263,7 @@ func GetUserIdentity(repo repository.Repo) (*Identity, error) { i, err := ReadLocal(repo, id) if err == ErrIdentityNotExist { - innerErr := repo.RmConfigs(identityConfigKey) + innerErr := repo.LocalConfig().RemoveAll(identityConfigKey) if innerErr != nil { _, _ = fmt.Fprintln(os.Stderr, errors.Wrap(innerErr, "can't clear user identity").Error()) } |