mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
update jgit to 3.0.0.201306101825-r
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -430,7 +430,7 @@
|
|||||||
<shiro.version>1.2.2</shiro.version>
|
<shiro.version>1.2.2</shiro.version>
|
||||||
|
|
||||||
<!-- repostitory libraries -->
|
<!-- repostitory libraries -->
|
||||||
<jgit.version>2.3.1.201302201838-r</jgit.version>
|
<jgit.version>3.0.0.201306101825-r</jgit.version>
|
||||||
<svnkit.version>1.7.9-scm2</svnkit.version>
|
<svnkit.version>1.7.9-scm2</svnkit.version>
|
||||||
|
|
||||||
<!-- build properties -->
|
<!-- build properties -->
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ package sonia.scm.repository;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
import org.eclipse.jgit.storage.file.FileRepository;
|
|
||||||
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
|
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
|
||||||
|
|
||||||
import sonia.scm.Type;
|
import sonia.scm.Type;
|
||||||
@@ -259,19 +258,19 @@ public class GitRepositoryHandler
|
|||||||
protected void create(Repository repository, File directory)
|
protected void create(Repository repository, File directory)
|
||||||
throws RepositoryException, IOException
|
throws RepositoryException, IOException
|
||||||
{
|
{
|
||||||
FileRepository fr = null;
|
org.eclipse.jgit.lib.Repository gitRepository = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fr = new FileRepositoryBuilder().setGitDir(
|
gitRepository = new FileRepositoryBuilder().setGitDir(
|
||||||
directory).readEnvironment().findGitDir().build();
|
directory).readEnvironment().findGitDir().build();
|
||||||
fr.create(true);
|
gitRepository.create(true);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (fr != null)
|
if (gitRepository != null)
|
||||||
{
|
{
|
||||||
fr.close();
|
gitRepository.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
import org.eclipse.jgit.storage.file.FileRepository;
|
import org.eclipse.jgit.internal.storage.file.FileRepository;
|
||||||
|
|
||||||
import sonia.scm.repository.GitRepositoryHandler;
|
import sonia.scm.repository.GitRepositoryHandler;
|
||||||
import sonia.scm.repository.GitUtil;
|
import sonia.scm.repository.GitUtil;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import org.eclipse.jgit.errors.MissingObjectException;
|
|||||||
import org.eclipse.jgit.errors.NoRemoteRepositoryException;
|
import org.eclipse.jgit.errors.NoRemoteRepositoryException;
|
||||||
import org.eclipse.jgit.errors.NotSupportedException;
|
import org.eclipse.jgit.errors.NotSupportedException;
|
||||||
import org.eclipse.jgit.errors.TransportException;
|
import org.eclipse.jgit.errors.TransportException;
|
||||||
|
import org.eclipse.jgit.internal.storage.file.FileRepository;
|
||||||
import org.eclipse.jgit.lib.Constants;
|
import org.eclipse.jgit.lib.Constants;
|
||||||
import org.eclipse.jgit.lib.Ref;
|
import org.eclipse.jgit.lib.Ref;
|
||||||
import org.eclipse.jgit.lib.RefComparator;
|
import org.eclipse.jgit.lib.RefComparator;
|
||||||
@@ -53,7 +54,6 @@ import org.eclipse.jgit.lib.RefUpdate;
|
|||||||
import org.eclipse.jgit.lib.TextProgressMonitor;
|
import org.eclipse.jgit.lib.TextProgressMonitor;
|
||||||
import org.eclipse.jgit.revwalk.RevCommit;
|
import org.eclipse.jgit.revwalk.RevCommit;
|
||||||
import org.eclipse.jgit.revwalk.RevWalk;
|
import org.eclipse.jgit.revwalk.RevWalk;
|
||||||
import org.eclipse.jgit.storage.file.FileRepository;
|
|
||||||
import org.eclipse.jgit.transport.CredentialsProvider;
|
import org.eclipse.jgit.transport.CredentialsProvider;
|
||||||
import org.eclipse.jgit.transport.FetchResult;
|
import org.eclipse.jgit.transport.FetchResult;
|
||||||
import org.eclipse.jgit.transport.PushResult;
|
import org.eclipse.jgit.transport.PushResult;
|
||||||
@@ -253,8 +253,7 @@ public class GitRepositoryClient extends AbstractRepositoryClient
|
|||||||
case REJECTED_REMOTE_CHANGED :
|
case REJECTED_REMOTE_CHANGED :
|
||||||
case REJECTED_OTHER_REASON :
|
case REJECTED_OTHER_REASON :
|
||||||
throw new RepositoryClientException(
|
throw new RepositoryClientException(
|
||||||
"could not update ref ".concat(
|
"could not update ref ".concat(refUpdate.getSrcRef()).concat(
|
||||||
refUpdate.getSrcRef()).concat(
|
|
||||||
" status ".concat(refUpdate.getStatus().toString())));
|
" status ".concat(refUpdate.getStatus().toString())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,8 +310,7 @@ public class GitRepositoryClient extends AbstractRepositoryClient
|
|||||||
* @throws URISyntaxException
|
* @throws URISyntaxException
|
||||||
*/
|
*/
|
||||||
private void addRemote(final String remoteName, final URIish uri,
|
private void addRemote(final String remoteName, final URIish uri,
|
||||||
final String branchName, final String tagName,
|
final String branchName, final String tagName, final boolean allSelected,
|
||||||
final boolean allSelected,
|
|
||||||
final Collection<Ref> selectedBranches)
|
final Collection<Ref> selectedBranches)
|
||||||
throws URISyntaxException, IOException
|
throws URISyntaxException, IOException
|
||||||
{
|
{
|
||||||
@@ -476,8 +474,7 @@ public class GitRepositoryClient extends AbstractRepositoryClient
|
|||||||
* @throws MissingObjectException
|
* @throws MissingObjectException
|
||||||
*/
|
*/
|
||||||
private RevCommit parseCommit(Ref branch)
|
private RevCommit parseCommit(Ref branch)
|
||||||
throws MissingObjectException, IncorrectObjectTypeException,
|
throws MissingObjectException, IncorrectObjectTypeException, IOException
|
||||||
IOException
|
|
||||||
{
|
{
|
||||||
final RevWalk rw = new RevWalk(repository);
|
final RevWalk rw = new RevWalk(repository);
|
||||||
final RevCommit commit;
|
final RevCommit commit;
|
||||||
|
|||||||
Reference in New Issue
Block a user