diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-01 22:16:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-01 22:16:57 +0000 |
commit | f5193cc76dd1a1c1bb55194a64ef90bae2278115 (patch) | |
tree | 74c5f184df4fb27bec0d6f809ce9816ec133d80f /identity | |
parent | 11b4a1beb7e1ab8809515a5ce21e8708fba7f300 (diff) | |
parent | f9f82957a78ea0d3cacddbc6914ce98b94ddf7bd (diff) | |
download | git-bug-f5193cc76dd1a1c1bb55194a64ef90bae2278115.tar.gz |
Merge pull request #240 from MichaelMure/repo-config
repository config interface and implementation rework
Diffstat (limited to 'identity')
-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()) } |