Skip to content

Commit

Permalink
Merge pull request #83 from ljfranklin/PR-add-git-logging
Browse files Browse the repository at this point in the history
Add additional logging to git driver
  • Loading branch information
James Thomson authored Apr 24, 2020
2 parents 9a35b60 + 905d2ad commit a7e3de1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions driver/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ func (driver *GitDriver) writeVersion(newVersion semver.Version) (bool, error) {
commitOutput, err := gitCommit.CombinedOutput()

if strings.Contains(string(commitOutput), nothingToCommitString) {
os.Stderr.Write([]byte("Nothing to commit, skipping version push\n"))
return true, nil
}

Expand All @@ -376,15 +377,10 @@ func (driver *GitDriver) writeVersion(newVersion semver.Version) (bool, error) {

pushOutput, err := gitPush.CombinedOutput()

if strings.Contains(string(pushOutput), falsePushString) {
return false, nil
}

if strings.Contains(string(pushOutput), pushRejectedString) {
return false, nil
}

if strings.Contains(string(pushOutput), pushRemoteRejectedString) {
if strings.Contains(string(pushOutput), falsePushString) ||
strings.Contains(string(pushOutput), pushRejectedString) ||
strings.Contains(string(pushOutput), pushRemoteRejectedString) {
os.Stderr.Write(pushOutput)
return false, nil
}

Expand Down

0 comments on commit a7e3de1

Please sign in to comment.