aboutsummaryrefslogtreecommitdiffstats
path: root/repository/config.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-11-27 20:51:37 -0500
committerSteve Moyer <smoyer1@selesy.com>2022-11-27 20:51:37 -0500
commit64c18b15a4a0c8b7e59587aa09de92d52c698ede (patch)
tree8738e651e57c3cf7a21ae76e9733206ccea7a6b9 /repository/config.go
parentc6bb6b9c7ecddb679966b1561e2e909a9ee5e8cd (diff)
downloadgit-bug-64c18b15a4a0c8b7e59587aa09de92d52c698ede.tar.gz
feat: wrap ErrNoConfigEntry to report missing key
Resolves #935.
Diffstat (limited to 'repository/config.go')
-rw-r--r--repository/config.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/repository/config.go b/repository/config.go
index c6880b7d..4d6a8c6c 100644
--- a/repository/config.go
+++ b/repository/config.go
@@ -96,7 +96,7 @@ func (m *mergedConfig) ReadBool(key string) (bool, error) {
if err == nil {
return v, nil
}
- if err != ErrNoConfigEntry && err != ErrMultipleConfigEntry {
+ if !errors.Is(err, ErrNoConfigEntry) && err != ErrMultipleConfigEntry {
return false, err
}
return m.global.ReadBool(key)
@@ -107,7 +107,7 @@ func (m *mergedConfig) ReadString(key string) (string, error) {
if err == nil {
return val, nil
}
- if err != ErrNoConfigEntry && err != ErrMultipleConfigEntry {
+ if !errors.Is(err, ErrNoConfigEntry) && err != ErrMultipleConfigEntry {
return "", err
}
return m.global.ReadString(key)
@@ -118,7 +118,7 @@ func (m *mergedConfig) ReadTimestamp(key string) (time.Time, error) {
if err == nil {
return val, nil
}
- if err != ErrNoConfigEntry && err != ErrMultipleConfigEntry {
+ if !errors.Is(err, ErrNoConfigEntry) && err != ErrMultipleConfigEntry {
return time.Time{}, err
}
return m.global.ReadTimestamp(key)