Skip to content

Commit

Permalink
Upgrade to JGit 5
Browse files Browse the repository at this point in the history
This fixes #233.
  • Loading branch information
ajoberstar committed Jul 4, 2018
1 parent 7b24d83 commit 36f2626
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 39 deletions.
5 changes: 2 additions & 3 deletions grgit-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ dependencies {
implementation 'org.codehaus.groovy:groovy:[2.5.0, 2.6.0-alpha)'

// jgit
def jgitVersion = '4.11.0.201803080745-r'
compile "org.eclipse.jgit:org.eclipse.jgit:$jgitVersion"
compile "org.eclipse.jgit:org.eclipse.jgit.ui:$jgitVersion"
compile 'org.eclipse.jgit:org.eclipse.jgit:latest.release'
compile 'org.eclipse.jgit:org.eclipse.jgit.ui:latest.release'

// agentproxy
implementation 'com.jcraft:jsch.agentproxy.core:latest.release'
Expand Down
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/compile.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/compileClasspath.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.codehaus.groovy:groovy:2.5.0
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/default.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.codehaus.groovy:groovy:2.5.0
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/runtime.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/runtimeClasspath.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.codehaus.groovy:groovy:2.5.0
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/testCompile.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ org.codehaus.groovy:groovy-swing:2.5.0
org.codehaus.groovy:groovy-templates:2.5.0
org.codehaus.groovy:groovy-test:2.5.0
org.codehaus.groovy:groovy:2.5.0
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.hamcrest:hamcrest-core:1.3
org.slf4j:slf4j-api:1.8.0-beta2
org.spockframework:spock-core:1.2-groovy-2.5-SNAPSHOT
4 changes: 2 additions & 2 deletions grgit-core/gradle/dependency-locks/testRuntime.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.8.0-beta2
org.slf4j:slf4j-simple:1.8.0-beta2
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ org.codehaus.groovy:groovy-swing:2.5.0
org.codehaus.groovy:groovy-templates:2.5.0
org.codehaus.groovy:groovy-test:2.5.0
org.codehaus.groovy:groovy:2.5.0
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.hamcrest:hamcrest-core:1.3
org.slf4j:slf4j-api:1.8.0-beta2
org.slf4j:slf4j-simple:1.8.0-beta2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class MergeOp implements Callable<Void> {
* we want to preserve ref name in merge commit msg. if it's a ref, don't
* resolve down to commit id
*/
def ref = repo.jgit.repository.getRef(head)
def ref = repo.jgit.repository.findRef(head)
if (ref == null) {
def revstr = new ResolveService(repo).toRevisionString(head)
cmd.include(JGitUtil.resolveObject(repo, revstr))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BranchService {
* @return the branch or {@code null} if the HEAD is detached
*/
Branch current() {
Ref ref = repository.jgit.repository.getRef('HEAD')?.target
Ref ref = repository.jgit.repository.exactRef('HEAD')?.target
return ref ? JGitUtil.resolveBranch(repository, ref) : null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ResolveService {
} else if (object instanceof Commit) {
return object.id
} else if (object instanceof Branch || object instanceof Tag || object instanceof Ref) {
return ObjectId.toString(repository.jgit.repository.getRef(object.fullName).objectId)
return ObjectId.toString(repository.jgit.repository.exactRef(object.fullName).objectId)
} else {
throwIllegalArgument(object)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class JGitUtil {
* @return the resolved branch
*/
static Branch resolveBranch(Repository repo, String name) {
Ref ref = repo.jgit.repository.getRef(name)
Ref ref = repo.jgit.repository.findRef(name)
return resolveBranch(repo, ref)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ commons-logging:commons-logging:1.2
junit:junit:4.12
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.hamcrest:hamcrest-core:1.3
org.slf4j:slf4j-api:1.7.2
org.spockframework:spock-core:1.1-groovy-2.4
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ net.java.dev.jna:jna-platform:4.1.0
net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.hamcrest:hamcrest-core:1.3
org.slf4j:slf4j-api:1.7.2
org.spockframework:spock-core:1.1-groovy-2.4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
4 changes: 2 additions & 2 deletions grgit-gradle/gradle/dependency-locks/default.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ net.java.dev.jna:jna-platform:4.1.0
net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ net.java.dev.jna:jna-platform:4.1.0
net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ net.java.dev.jna:jna-platform:4.1.0
net.java.dev.jna:jna:4.1.0
org.apache.httpcomponents:httpclient:4.5.2
org.apache.httpcomponents:httpcore:4.4.4
org.eclipse.jgit:org.eclipse.jgit.ui:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit:4.11.0.201803080745-r
org.eclipse.jgit:org.eclipse.jgit.ui:5.0.1.201806211838-r
org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r
org.slf4j:slf4j-api:1.7.2

0 comments on commit 36f2626

Please sign in to comment.