Skip to content

Commit e0046a0

Browse files
authored
Merge pull request #34 from xmudrii/fix-ensure-gitconfig
CheckGitConfigExists: properly handle non-existing config
2 parents c17552f + 742407a commit e0046a0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

mage/git.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ func CheckGitConfigExists() (bool, error) {
3939
)
4040

4141
stream, err := userName.RunSuccessOutput()
42-
if err != nil {
43-
return false, errors.Wrapf(err, "getting git %s", gitConfigNameKey)
44-
}
45-
if stream.OutputTrimNL() == "" {
42+
if err != nil || stream.OutputTrimNL() == "" {
4643
return false, nil
4744
}
4845

@@ -55,10 +52,7 @@ func CheckGitConfigExists() (bool, error) {
5552
)
5653

5754
stream, err = userEmail.RunSuccessOutput()
58-
if err != nil {
59-
return false, errors.Wrapf(err, "getting git %s", gitConfigEmailKey)
60-
}
61-
if stream.OutputTrimNL() == "" {
55+
if err != nil || stream.OutputTrimNL() == "" {
6256
return false, nil
6357
}
6458

0 commit comments

Comments
 (0)