<classpathentry kind="lib" path="ext/lucene-queries-3.6.1.jar" sourcepath="ext/src/lucene-queries-3.6.1.jar" />
<classpathentry kind="lib" path="ext/jakarta-regexp-1.4.jar" />
<classpathentry kind="lib" path="ext/markdownpapers-core-1.3.2.jar" sourcepath="ext/src/markdownpapers-core-1.3.2.jar" />
- <classpathentry kind="lib" path="ext/org.eclipse.jgit-2.3.1.201302201838-r.jar" sourcepath="ext/src/org.eclipse.jgit-2.3.1.201302201838-r.jar" />
+ <classpathentry kind="lib" path="ext/org.eclipse.jgit-3.0.0-SNAPSHOT.jar" sourcepath="ext/src/org.eclipse.jgit-3.0.0-SNAPSHOT.jar" />
<classpathentry kind="lib" path="ext/jsch-0.1.46.jar" sourcepath="ext/src/jsch-0.1.46.jar" />
- <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-2.3.1.201302201838-r.jar" sourcepath="ext/src/org.eclipse.jgit.http.server-2.3.1.201302201838-r.jar" />
+ <classpathentry kind="lib" path="ext/JavaEWAH-0.5.6.jar" sourcepath="ext/src/JavaEWAH-0.5.6.jar" />
+ <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-3.0.0-SNAPSHOT.jar" sourcepath="ext/src/org.eclipse.jgit.http.server-3.0.0-SNAPSHOT.jar" />
<classpathentry kind="lib" path="ext/bcprov-jdk15on-1.47.jar" sourcepath="ext/src/bcprov-jdk15on-1.47.jar" />
<classpathentry kind="lib" path="ext/bcmail-jdk15on-1.47.jar" sourcepath="ext/src/bcmail-jdk15on-1.47.jar" />
<classpathentry kind="lib" path="ext/bcpkix-jdk15on-1.47.jar" sourcepath="ext/src/bcpkix-jdk15on-1.47.jar" />
#
# Specify minimum Moxie version required to build
-requires: 0.7.1
+requires: 0.7.2
# Project Metadata
name: Gitblit
description: pure Java Git solution
groupId: com.gitblit
artifactId: gitblit
-version: 1.4.0-SNAPSHOT
+version: 1.3.0-SNAPSHOT
inceptionYear: 2011
# Current stable release
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="org.eclipse.jgit-2.3.1.201302201838-r.jar">
+ <library name="org.eclipse.jgit-3.0.0-SNAPSHOT.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit-2.3.1.201302201838-r.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit-3.0.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit-2.3.1.201302201838-r.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit-3.0.0-SNAPSHOT.jar!/" />
</SOURCES>
</library>
</orderEntry>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="org.eclipse.jgit.http.server-2.3.1.201302201838-r.jar">
+ <library name="JavaEWAH-0.5.6.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit.http.server-2.3.1.201302201838-r.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/JavaEWAH-0.5.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit.http.server-2.3.1.201302201838-r.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/JavaEWAH-0.5.6.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="org.eclipse.jgit.http.server-3.0.0-SNAPSHOT.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/org.eclipse.jgit.http.server-3.0.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/org.eclipse.jgit.http.server-3.0.0-SNAPSHOT.jar!/" />
</SOURCES>
</library>
</orderEntry>
- Use standard ServletRequestWrapper instead of custom wrapper (issue 224)\r
\r
changes:\r
+ - Disable Gson's pretty printing which has a huge performance gain\r
+ - Properly set application/json content-type on api calls\r
- Updated Polish translation\r
\r
additions: \r
contributors:\r
- Bandarupalli Satyanarayana\r
- Christian Aistleitner\r
+ - David Ostrovsky\r
- Egbert Teeselink\r
- Hige Maniya\r
- Ikslawek\r
- github/dapengme\r
\r
dependencyChanges:\r
- - JGit 2.3.1.201302201838-r\r
+ - JGit 3.0.0-SNAPSHOT\r
\r
settings:\r
- { name: 'git.daemonBindInterface', defaultValue: 'localhost' }\r
\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.lib.RepositoryCache.FileKey;\r
-import org.eclipse.jgit.storage.file.FileBasedConfig;\r
+import org.eclipse.jgit.lib.StoredConfig;\r
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
import org.eclipse.jgit.util.FS;\r
\r
import com.beust.jcommander.JCommander;\r
try {\r
// load repository config\r
File gitDir = FileKey.resolve(new File(folder, repo), FS.DETECTED);\r
- FileRepository repository = (FileRepository)new FileRepositoryBuilder().setGitDir(gitDir).build();\r
- FileBasedConfig config = repository.getConfig();\r
+ Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();\r
+ StoredConfig config = repository.getConfig();\r
config.load();\r
\r
Set<String> indexedBranches = new LinkedHashSet<String>();\r
import java.util.Calendar;\r
import java.util.Date;\r
import java.util.Map;\r
+import java.util.Properties;\r
import java.util.concurrent.ConcurrentHashMap;\r
import java.util.concurrent.atomic.AtomicBoolean;\r
import java.util.concurrent.atomic.AtomicInteger;\r
\r
+import org.eclipse.jgit.api.GarbageCollectCommand;\r
+import org.eclipse.jgit.api.Git;\r
import org.eclipse.jgit.lib.Repository;\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
-import org.eclipse.jgit.internal.storage.file.GC;\r
-import org.eclipse.jgit.internal.storage.file.GC.RepoStatistics;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
}\r
boolean garbageCollected = false;\r
RepositoryModel model = null;\r
- FileRepository repository = null;\r
+ Repository repository = null;\r
try {\r
model = GitBlit.self().getRepositoryModel(repositoryName);\r
- repository = (FileRepository) GitBlit.self().getRepository(repositoryName);\r
+ repository = GitBlit.self().getRepository(repositoryName);\r
if (repository == null) {\r
logger.warn(MessageFormat.format("GCExecutor is missing repository {0}?!?", repositoryName));\r
continue;\r
\r
logger.debug(MessageFormat.format("GCExecutor locked idle repository {0}", repositoryName));\r
\r
- GC gc = new GC(repository);\r
- RepoStatistics stats = gc.getStatistics();\r
+ Git git = new Git(repository);\r
+ GarbageCollectCommand gc = git.gc();\r
+ Properties stats = gc.getStatistics();\r
\r
// determine if this is a scheduled GC\r
Calendar cal = Calendar.getInstance();\r
\r
// determine if filesize triggered GC\r
long gcThreshold = FileUtils.convertSizeToLong(model.gcThreshold, 500*1024L);\r
- boolean hasEnoughGarbage = stats.sizeOfLooseObjects >= gcThreshold;\r
+ long sizeOfLooseObjects = (Long) stats.get("sizeOfLooseObjects");\r
+ boolean hasEnoughGarbage = sizeOfLooseObjects >= gcThreshold;\r
\r
// if we satisfy one of the requirements, GC\r
- boolean hasGarbage = stats.sizeOfLooseObjects > 0;\r
+ boolean hasGarbage = sizeOfLooseObjects > 0;\r
if (hasGarbage && (hasEnoughGarbage || shouldCollectGarbage)) {\r
- long looseKB = stats.sizeOfLooseObjects/1024L;\r
+ long looseKB = sizeOfLooseObjects/1024L;\r
logger.info(MessageFormat.format("Collecting {1} KB of loose objects from {0}", repositoryName, looseKB));\r
\r
// do the deed\r
- gc.gc();\r
+ gc.call();\r
\r
garbageCollected = true;\r
}\r
running.set(false);\r
}\r
\r
- private boolean isRepositoryIdle(FileRepository repository) {\r
+ private boolean isRepositoryIdle(Repository repository) {\r
try {\r
// Read the use count.\r
// An idle use count is 2:\r
import org.eclipse.jgit.lib.RepositoryCache.FileKey;\r
import org.eclipse.jgit.lib.StoredConfig;\r
import org.eclipse.jgit.storage.file.FileBasedConfig;\r
-import org.eclipse.jgit.internal.storage.file.WindowCache;\r
import org.eclipse.jgit.storage.file.WindowCacheConfig;\r
import org.eclipse.jgit.util.FS;\r
import org.eclipse.jgit.util.FileUtils;\r
cfg.setPackedGitMMAP(settings.getBoolean(Keys.git.packedGitMmap, cfg.isPackedGitMMAP()));\r
\r
try {\r
- WindowCache.reconfigure(cfg);\r
+ cfg.install();\r
logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitWindowSize, cfg.getPackedGitWindowSize()));\r
logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitLimit, cfg.getPackedGitLimit()));\r
logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.deltaBaseCacheLimit, cfg.getDeltaBaseCacheLimit()));\r
import org.eclipse.jgit.revwalk.RevWalk;\r
import org.eclipse.jgit.revwalk.filter.CommitTimeRevFilter;\r
import org.eclipse.jgit.revwalk.filter.RevFilter;\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;\r
import org.eclipse.jgit.transport.CredentialsProvider;\r
import org.eclipse.jgit.transport.FetchResult;\r
File folder = new File(repositoriesFolder, name);\r
if (folder.exists()) {\r
File gitDir = FileKey.resolve(new File(repositoriesFolder, name), FS.DETECTED);\r
- FileRepository repository = (FileRepository)new FileRepositoryBuilder().setGitDir(gitDir).build();\r
+ Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();\r
result.fetchResult = fetchRepository(credentialsProvider, repository);\r
repository.close();\r
} else {\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.lib.RepositoryCache;\r
import org.eclipse.jgit.lib.RepositoryCache.FileKey;\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
+import org.eclipse.jgit.storage.file.FileRepositoryBuilder;\r
import org.eclipse.jgit.util.FS;\r
import org.junit.AfterClass;\r
import org.junit.BeforeClass;\r
private static AtomicBoolean started = new AtomicBoolean(false);\r
\r
public static Repository getHelloworldRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "helloworld.git"));\r
+ return getRepository("helloworld.git");\r
}\r
\r
public static Repository getTicgitRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "ticgit.git"));\r
+ return getRepository("ticgit.git");\r
}\r
\r
public static Repository getJGitRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "test/jgit.git"));\r
+ return getRepository("test/jgit.git");\r
}\r
\r
public static Repository getAmbitionRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "test/ambition.git"));\r
+ return getRepository("test/ambition.git");\r
}\r
\r
public static Repository getTheoreticalPhysicsRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "test/theoretical-physics.git"));\r
+ return getRepository("test/theoretical-physics.git");\r
}\r
\r
public static Repository getIssuesTestRepository() throws Exception {\r
JGitUtils.createRepository(REPOSITORIES, "gb-issues.git").close();\r
- return new FileRepository(new File(REPOSITORIES, "gb-issues.git"));\r
+ return getRepository("gb-issues.git");\r
}\r
\r
public static Repository getGitectiveRepository() throws Exception {\r
- return new FileRepository(new File(REPOSITORIES, "test/gitective.git"));\r
+ return getRepository("test/gitective.git");\r
+ }\r
+ \r
+ private static Repository getRepository(String name) throws Exception {\r
+ File gitDir = FileKey.resolve(new File(REPOSITORIES, name), FS.DETECTED);\r
+ Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();\r
+ return repository;\r
}\r
\r
public static boolean startGitblit() throws Exception {\r
import org.eclipse.jgit.api.ResetCommand.ResetType;\r
import org.eclipse.jgit.api.errors.GitAPIException;\r
import org.eclipse.jgit.lib.Constants;\r
+import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
+import org.eclipse.jgit.storage.file.FileRepositoryBuilder;\r
import org.eclipse.jgit.transport.CredentialsProvider;\r
import org.eclipse.jgit.transport.PushResult;\r
import org.eclipse.jgit.transport.RefSpec;\r
public void testPushLog() throws IOException {\r
String name = "refchecks/ticgit.git";\r
File refChecks = new File(GitBlitSuite.REPOSITORIES, name);\r
- FileRepository repository = new FileRepository(refChecks);\r
+ Repository repository = new FileRepositoryBuilder().setGitDir(refChecks).build();\r
List<PushLogEntry> pushes = PushLogUtils.getPushLog(name, repository);\r
GitBlitSuite.close(repository);\r
assertTrue("Repository has an empty push log!", pushes.size() > 0);\r
import java.io.IOException;\r
import java.util.List;\r
\r
-import org.eclipse.jgit.internal.storage.file.FileRepository;\r
+import org.eclipse.jgit.lib.Repository;\r
+import org.eclipse.jgit.lib.RepositoryCache.FileKey;\r
+import org.eclipse.jgit.storage.file.FileRepositoryBuilder;\r
+import org.eclipse.jgit.util.FS;\r
import org.junit.Test;\r
\r
import com.gitblit.models.PushLogEntry;\r
@Test\r
public void testPushLog() throws IOException {\r
String name = "~james/helloworld.git";\r
- FileRepository repository = new FileRepository(new File(GitBlitSuite.REPOSITORIES, name));\r
+ File gitDir = FileKey.resolve(new File(GitBlitSuite.REPOSITORIES, name), FS.DETECTED);\r
+ Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();\r
List<PushLogEntry> pushes = PushLogUtils.getPushLog(name, repository);\r
GitBlitSuite.close(repository);\r
}\r