From: James Moger Date: Wed, 11 Jul 2012 21:17:00 +0000 (-0400) Subject: Update to JGit 2.0.0 X-Git-Tag: v1.0.0~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d9bd7e01c5e39a22687379d00d9622328162f6a;p=gitblit.git Update to JGit 2.0.0 --- diff --git a/.classpath b/.classpath index 37eb634d..1c3065cf 100644 --- a/.classpath +++ b/.classpath @@ -26,8 +26,8 @@ - - + + diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 772c768d..8153b444 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -38,7 +38,7 @@ public class Constants { // The build script extracts this exact line so be careful editing it // and only use A-Z a-z 0-9 .-_ in the string. - public static final String JGIT_VERSION = "JGit 1.3.0 (201202151440-r)"; + public static final String JGIT_VERSION = "JGit 2.0.0 (201206130900-r)"; public static final String ADMIN_ROLE = "#admin"; diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 27d43c8e..10b12534 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -58,6 +58,7 @@ import org.eclipse.jgit.lib.RepositoryCache.FileKey; import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.storage.file.WindowCache; import org.eclipse.jgit.storage.file.WindowCacheConfig; +import org.eclipse.jgit.transport.ServiceMayNotContinueException; import org.eclipse.jgit.transport.resolver.FileResolver; import org.eclipse.jgit.transport.resolver.RepositoryResolver; import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; @@ -783,6 +784,12 @@ public class GitBlit implements ServletContextListener { logger.error("GitBlit.getRepository(String) failed to find " + new File(repositoriesFolder, repositoryName).getAbsolutePath(), e); } + } catch (ServiceMayNotContinueException e) { + r = null; + if (logError) { + logger.error("GitBlit.getRepository(String) failed to find " + + new File(repositoriesFolder, repositoryName).getAbsolutePath(), e); + } } return r; } @@ -1087,6 +1094,8 @@ public class GitBlit implements ServletContextListener { logger.error("Service not authorized", e); } catch (ServiceNotEnabledException e) { logger.error("Service not enabled", e); + } catch (ServiceMayNotContinueException e) { + logger.error("Service may not continue", e); } } diff --git a/src/com/gitblit/build/Build.java b/src/com/gitblit/build/Build.java index e75c4c4d..ed54f9ee 100644 --- a/src/com/gitblit/build/Build.java +++ b/src/com/gitblit/build/Build.java @@ -544,15 +544,15 @@ public class Build { "3b7c5f3938f202311bdca0bf7ed46bc0118af081"); public static final MavenObject JGIT = new MavenObject("JGit", "org/eclipse/jgit", - "org.eclipse.jgit", "1.3.0.201202151440-r", 1532000, 1565000, 3460000, - "a00dc524b1d1db1abbf95407aa3e6009c3d2c157", - "68864beaa0856f539deafecf9e1fe105a7e996c3", + "org.eclipse.jgit", "2.0.0.201206130900-r", 1600000, 1565000, 3460000, + "c8934e903ef26ec9aa1d0d3b604979c77eda4137", + "7e2c1486bf13e7bbdf39b68554e9010abe385c32", ""); public static final MavenObject JGIT_HTTP = new MavenObject("JGit", "org/eclipse/jgit", - "org.eclipse.jgit.http.server", "1.3.0.201202151440-r", 68000, 62000, 110000, - "099468bdd59d6f4919d54d5b66022d3ec8077b29", - "721ef2b857a7e92989a8f1ee688e361510303bb1", + "org.eclipse.jgit.http.server", "2.0.0.201206130900-r", 68000, 62000, 110000, + "d42535d996ccfc487092a8850e6e78d368de72d6", + "85d5ba16db13144815634aeff31ad6c7d92107e6", ""); public static final MavenObject JSCH = new MavenObject("JSch", "com/jcraft", "jsch", diff --git a/src/com/gitblit/build/BuildGhPages.java b/src/com/gitblit/build/BuildGhPages.java index efeb43c4..5982ac30 100644 --- a/src/com/gitblit/build/BuildGhPages.java +++ b/src/com/gitblit/build/BuildGhPages.java @@ -25,12 +25,12 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; -import org.eclipse.jgit.JGitText; import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; import org.eclipse.jgit.dircache.DirCacheEntry; +import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.CommitBuilder; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; diff --git a/src/com/gitblit/utils/IssueUtils.java b/src/com/gitblit/utils/IssueUtils.java index cfd6200d..7b24ccf7 100644 --- a/src/com/gitblit/utils/IssueUtils.java +++ b/src/com/gitblit/utils/IssueUtils.java @@ -28,12 +28,12 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import org.eclipse.jgit.JGitText; import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; import org.eclipse.jgit.dircache.DirCacheEntry; +import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.CommitBuilder; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index ab5b655b..62d27da8 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -35,6 +35,7 @@ import java.util.zip.ZipOutputStream; import org.eclipse.jgit.api.CloneCommand; import org.eclipse.jgit.api.FetchCommand; import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.diff.DiffEntry; import org.eclipse.jgit.diff.DiffEntry.ChangeType; import org.eclipse.jgit.diff.DiffFormatter; @@ -257,8 +258,12 @@ public class JGitUtils { * @return Repository */ public static Repository createRepository(File repositoriesFolder, String name) { - Git git = Git.init().setDirectory(new File(repositoriesFolder, name)).setBare(true).call(); - return git.getRepository(); + try { + Git git = Git.init().setDirectory(new File(repositoriesFolder, name)).setBare(true).call(); + return git.getRepository(); + } catch (GitAPIException e) { + throw new RuntimeException(e); + } } /**