Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to jgit 3.0 since it's released. #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions org.gitective.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>org.gitective</groupId>
<artifactId>gitective-core</artifactId>
<version>0.9.10-SNAPSHOT</version>
<version>0.9.10</version>
<name>gitective core</name>
<description>gitective core library</description>
<url>http://gitective.org</url>
Expand Down Expand Up @@ -190,7 +190,7 @@
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>2.0.0.201206130900-r</version>
<version>3.0.0.201306101825-r</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import java.util.Collection;
import java.util.List;

import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;

/**
* Base service class for working with one or more {@link Repository} instances.
Expand Down Expand Up @@ -81,8 +82,12 @@ public RepositoryService(final File... gitDirs) {
final int length = gitDirs.length;
repositories = new Repository[length];
try {
for (int i = 0; i < length; i++)
repositories[i] = new FileRepository(gitDirs[i]);
for (int i = 0; i < length; i++) {
repositories[i] = new FileRepositoryBuilder()
.setGitDir(gitDirs[i])
.readEnvironment()
.build();
}
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
Expand Down Expand Up @@ -126,9 +131,9 @@ public RepositoryService(final Collection<?> repositories) {
try {
for (Object repo : repositories)
if (repo instanceof String)
created.add(new FileRepository((String) repo));
created.add(new FileRepositoryBuilder().setGitDir(new File((String)repo)).readEnvironment().build());
else if (repo instanceof File)
created.add(new FileRepository((File) repo));
created.add(new FileRepositoryBuilder().setGitDir((File)repo).readEnvironment().build());
else if (repo instanceof Repository)
created.add((Repository) repo);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.io.File;
import java.io.IOException;

import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.lib.BaseRepositoryBuilder;
import org.eclipse.jgit.lib.RefDatabase;
import org.eclipse.jgit.storage.file.FileRepository;

/**
* Repository that has a bad ref database
Expand Down
Loading