aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-10-31 14:43:27 +0100
committerGitHub <noreply@github.com>2020-10-31 14:43:27 +0100
commitdda9f15b4eff719b75e6a5880191d2af886bbdee (patch)
tree59e3f549951c28d1ef90c8bff25fa68fa97af7b3
parent64efbf7c08691d50151142c5faef4877670b5bc5 (diff)
parent9f1d0e6f8baf0d6fde54829fcd2b8971ec160356 (diff)
downloadgit-bug-dda9f15b4eff719b75e6a5880191d2af886bbdee.tar.gz
Merge pull request #490 from xloem/name
read name from both global and local config
-rw-r--r--repository/gogit.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/repository/gogit.go b/repository/gogit.go
index b30effb5..c59409d4 100644
--- a/repository/gogit.go
+++ b/repository/gogit.go
@@ -202,22 +202,12 @@ func (repo *GoGitRepo) GetPath() string {
// GetUserName returns the name the the user has used to configure git
func (repo *GoGitRepo) GetUserName() (string, error) {
- cfg, err := repo.r.Config()
- if err != nil {
- return "", err
- }
-
- return cfg.User.Name, nil
+ return repo.AnyConfig().ReadString("user.name")
}
// GetUserEmail returns the email address that the user has used to configure git.
func (repo *GoGitRepo) GetUserEmail() (string, error) {
- cfg, err := repo.r.Config()
- if err != nil {
- return "", err
- }
-
- return cfg.User.Email, nil
+ return repo.AnyConfig().ReadString("user.email")
}
// GetCoreEditor returns the name of the editor that the user has used to configure git.