mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
read name from both global and local config
This commit is contained in:
parent
64efbf7c08
commit
9f1d0e6f8b
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user