Skip to content

Commit

Permalink
Merge branch 'release/2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirrane committed Jul 22, 2016
2 parents 3024b87 + ae84f2a commit 4babd40
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'application'
//apply plugin: 'maven-publish'

group = 'com.dkirrane.groovy.gitflow'
version = '2.4'
version = '2.5'

mainClassName = "com.dkirrane.gitflow.groovy.conflicts.Main"

Expand Down
29 changes: 29 additions & 0 deletions src/main/groovy/com/dkirrane/gitflow/groovy/GitflowCommon.groovy
Expand Up @@ -455,6 +455,35 @@ class GitflowCommon {
}
}

void checkRemoteConnection() {
log.debug("Verifying we can connect to the remote Git repo")
def origin = getOrigin()
if(origin) {
StringBuilder standard = new StringBuilder(450000)
StringBuilder error = new StringBuilder(450000)
def process = "git fetch --all".execute(envp, repoDir)
process.consumeProcessOutput(standard, error)
process.waitFor()

String stOut = standard.toString()
String stErr = error.toString()
Integer exitCode = process.exitValue()

if(exitCode != 0 || stErr) {
println("")
log.info stOut
log.error "Cannot connect to remote Git repo '${origin}' ${getOriginURL()}. Check your Git credentials."
log.error stErr.trim()
log.error "(exit code ${exitCode})"
println("")
}

if(exitCode != 0) {
throw new GitflowException("Cannot connect to remote Git repo '${origin}'. Check your Git credentials.")
}
}
}

void requireGitflowInitialized() {
}

Expand Down

0 comments on commit 4babd40

Please sign in to comment.