Skip to content

Commit

Permalink
Merge pull request #92 from mgsolid/bug/issues-89
Browse files Browse the repository at this point in the history
fix issues 89
  • Loading branch information
vito authored Sep 25, 2019
2 parents 790e42e + 7fbcc9b commit 90b999a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions driver/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var privateKeyPath string
var netRcPath string

var ErrEncryptedKey = errors.New("private keys with passphrases are not supported")
var RetriesOnErrorWriteVersion = 3

func init() {
gitRepoDir = filepath.Join(os.TempDir(), "semver-git-repo")
Expand Down Expand Up @@ -54,12 +55,7 @@ func (driver *GitDriver) Bump(bump version.Bump) (semver.Version, error) {

var newVersion semver.Version

err = driver.skipSSLVerificationIfNeeded()
if err != nil {
return semver.Version{}, err
}

for {
for i := 1; i <= RetriesOnErrorWriteVersion; i++ {
err = driver.setUpRepo()
if err != nil {
return semver.Version{}, err
Expand All @@ -79,7 +75,10 @@ func (driver *GitDriver) Bump(bump version.Bump) (semver.Version, error) {
wrote, err := driver.writeVersion(newVersion)
if wrote {
break
}
}
}
if err != nil {
return semver.Version{}, err
}

return newVersion, nil
Expand All @@ -96,12 +95,7 @@ func (driver *GitDriver) Set(newVersion semver.Version) error {
return err
}

err = driver.skipSSLVerificationIfNeeded()
if err != nil {
return err
}

for {
for i := 1; i <= RetriesOnErrorWriteVersion; i++ {
err = driver.setUpRepo()
if err != nil {
return err
Expand Down

0 comments on commit 90b999a

Please sign in to comment.