Skip to content

Commit

Permalink
Merge pull request #19 from ajoberstar/issue-18
Browse files Browse the repository at this point in the history
Support all valid Git URI-ish
  • Loading branch information
ajoberstar authored Feb 17, 2017
2 parents a9b9649 + f7be1d7 commit 12b8220
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
}

stutter {
supports '3.0', '3.1', '3.2', '3.2.1'
supports '3.0', '3.1', '3.2', '3.2.1', '3.3', '3.4-rc-3'
}

model {
Expand Down Expand Up @@ -56,5 +56,5 @@ pluginBundle {
}

wrapper {
gradleVersion = '3.2'
gradleVersion = '3.3'
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Nov 05 15:55:20 CDT 2016
#Thu Feb 16 18:55:04 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.Copy
import org.gradle.api.file.FileTree
import org.eclipse.jgit.transport.URIish

class GitPublishPlugin implements Plugin<Project> {
@PackageScope static final String RESET_TASK = 'gitPublishReset'
Expand Down Expand Up @@ -157,7 +158,8 @@ class GitPublishPlugin implements Plugin<Project> {
Optional.of(Grgit.open(dir: extension.repoDir))
.filter { repo ->
String originUri = repo.remote.list().find { it.name == 'origin' }?.url
boolean valid = new URI(extension.repoUri) == new URI(originUri) && extension.branch == repo.branch.current.name
// need to use the URIish to normalize them and ensure we support all Git compatible URI-ishs (URL is too limiting)
boolean valid = new URIish(extension.repoUri) == new URIish(originUri) && extension.branch == repo.branch.current.name
if (!valid) { repo.close() }
return valid
}
Expand Down

0 comments on commit 12b8220

Please sign in to comment.