diff --git a/repository/gogit.go b/repository/gogit.go index b30effb59b9011eb5cad7f22e62650e4c9cc835e..c59409d493214d7a6e6379edbe48769cef03dd99 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.