Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'delta'

* delta: (103 commits)
  Discard the uncompressed delta as soon as its compressed
  Honor pack.windowlimit to cap memory usage during packing
  Honor pack.threads and perform delta search in parallel
  Cache small deltas during packing
  Implement delta generation during packing
  debug-show-packdelta:  Dump a pack delta to the console
  Initial pack format delta generator
  Add debugging toString() method to ObjectToPack
  Make ObjectToPack clearReuseAsIs signal available to subclasses
  Correctly classify the compressing objects phase
  Refactor ObjectToPack's delta depth setting
  Configure core.bigFileThreshold into PackWriter
  Add doNotDelta flag to ObjectToPack
  Add more configuration options to PackWriter
  Save object path hash codes during packing
  Add path hash code to ObjectWalk
  Add getObjectSize to ObjectReader
  Allow TemporaryBuffer.Heap to allocate smaller than 8 KiB
  Define a constant for 127 in DeltaEncoder
  Cap delta copy instructions at 64k
  ...

Conflicts:
	org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
	org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties
	org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
	org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteTreeFilter.java

Change-Id: I7c7a05e443a48d32c836173a409ee7d340c70796
  • Loading branch information...
commit fa9b225e06f16ca7fd7ffca5689f4af0942a73e1 2 parents ab062ca + 12fe0f2
Shawn O. Pearce authored

Showing 243 changed files with 14,011 additions and 5,615 deletions. Show diff stats Hide diff stats

  1. +1 0  org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
  2. +2 2 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java
  3. +27 22 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
  4. +1 1  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java
  5. +1 1  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java
  6. +6 1 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
  7. +2 0  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
  8. +12 2 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
  9. +3 1 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/FileResolver.java
  10. +1 0  org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
  11. +5 4 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java
  12. +5 4 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java
  13. +9 8 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
  14. +8 7 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
  15. +4 2 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/util/HttpTestCase.java
  16. +1 0  org.eclipse.jgit.iplog/META-INF/MANIFEST.MF
  17. +7 11 org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
  18. +2 2 org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java
  19. +2 0  org.eclipse.jgit.junit/META-INF/MANIFEST.MF
  20. +9 8 org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
  21. +1 1  org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
  22. +117 66 org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
  23. +2 0  org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
  24. +1 0  org.eclipse.jgit.pgm/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin
  25. +12 9 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
  26. +5 3 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
  27. +3 1 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
  28. +2 2 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java
  29. +8 68 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
  30. +11 7 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
  31. +2 2 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
  32. +3 6 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java
  33. +15 11 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/UploadPack.java
  34. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java
  35. +1 2  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
  36. +2 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
  37. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java
  38. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
  39. +127 0 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
  40. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java
  41. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Iplog.java
  42. +1 1  org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Ipzilla.java
  43. +3 3 org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
  44. +2 0  org.eclipse.jgit.test/META-INF/MANIFEST.MF
  45. +1 1  org.eclipse.jgit.test/exttst/org/eclipse/jgit/lib/T0007_GitIndexTest.java
  46. +22 22 org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
  47. +9 9 org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
  48. +15 1 org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/SimilarityIndexTest.java
  49. +10 10 org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
  50. +1 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
  51. +10 10 org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
  52. +1 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java
  53. +8 8 org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
  54. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java
  55. +7 7 org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java
  56. +9 9 org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java
  57. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
  58. +4 3 org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java
  59. +1 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java
  60. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WorkDirCheckout_ReadTreeTest.java
  61. +15 13 org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java
  62. +39 36 org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java
  63. +3 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
  64. +19 7 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/ConcurrentRepackTest.java
  65. +387 0 org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackFileTest.java
  66. +3 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/PackIndexTestCase.java
  67. +2 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/PackIndexV1Test.java
  68. +2 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/PackIndexV2Test.java
  69. +3 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/PackReverseIndexTest.java
  70. +16 7 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/PackWriterTest.java
  71. +5 1 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/RefDirectoryTest.java
  72. +22 9 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/RefUpdateTest.java
  73. +5 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/ReflogReaderTest.java
  74. +45 41 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/RepositorySetupWorkDirTest.java
  75. +62 44 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/T0003_Basic.java
  76. +8 7 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/T0004_PackReader.java
  77. +534 0 org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/UnpackedObjectTest.java
  78. +8 11 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/WindowCacheGetTest.java
  79. +3 1 org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/WindowCacheReconfigureTest.java
  80. +1 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/{lib → storage/file}/XInputStream.java
  81. +228 0 org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/pack/DeltaIndexTest.java
  82. +273 0 org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/pack/DeltaStreamTest.java
  83. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java
  84. +1 1  org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/IndexPackTest.java
  85. +17 17 org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java
  86. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
  87. +2 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/AbstractTreeIteratorTest.java
  88. +5 2 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java
  89. +3 1 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
  90. +8 8 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java
  91. +3 3 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java
  92. +17 13 org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTestCase.java
  93. +3 0  org.eclipse.jgit/META-INF/MANIFEST.MF
  94. +3 1 org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties
  95. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
  96. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
  97. +56 44 org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
  98. +36 32 org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
  99. +47 2 org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
  100. +14 8 org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
  101. +48 4 org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java
  102. +7 6 org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
  103. +6 50 org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
  104. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuildIterator.java
  105. +8 13 org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java
  106. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java
  107. +4 4 org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java
  108. +19 19 org.eclipse.jgit/src/org/eclipse/jgit/{lib/IndexChangedEvent.java → errors/LargeObjectException.java}
  109. +59 0 org.eclipse.jgit/src/org/eclipse/jgit/errors/NoWorkTreeException.java
  110. +61 0 org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java
  111. +57 0 org.eclipse.jgit/src/org/eclipse/jgit/events/ConfigChangedEvent.java
  112. +10 15 org.eclipse.jgit/src/org/eclipse/jgit/{lib/RepositoryAdapter.java → events/ConfigChangedListener.java}
  113. +57 0 org.eclipse.jgit/src/org/eclipse/jgit/events/IndexChangedEvent.java
  114. +6 20 org.eclipse.jgit/src/org/eclipse/jgit/{lib/RepositoryListener.java → events/IndexChangedListener.java}
  115. +22 18 org.eclipse.jgit/src/org/eclipse/jgit/{lib/RefsChangedEvent.java → events/ListenerHandle.java}
  116. +142 0 org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java
  117. +57 0 org.eclipse.jgit/src/org/eclipse/jgit/events/RefsChangedEvent.java
  118. +8 23 org.eclipse.jgit/src/org/eclipse/jgit/{lib/RepositoryChangedEvent.java → events/RefsChangedListener.java}
  119. +95 0 org.eclipse.jgit/src/org/eclipse/jgit/events/RepositoryEvent.java
  120. +49 0 org.eclipse.jgit/src/org/eclipse/jgit/events/RepositoryListener.java
  121. +0 142 org.eclipse.jgit/src/org/eclipse/jgit/lib/AlternateRepositoryDatabase.java
  122. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
  123. +616 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
  124. +4 9 org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobBasedConfig.java
  125. +0 132 org.eclipse.jgit/src/org/eclipse/jgit/lib/CachedObjectDatabase.java
  126. +8 1 org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java
  127. +14 1 org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java
  128. +0 82 org.eclipse.jgit/src/org/eclipse/jgit/lib/DeltaOfsPackedObjectLoader.java
  129. +0 118 org.eclipse.jgit/src/org/eclipse/jgit/lib/DeltaPackedObjectLoader.java
  130. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/lib/FileTreeEntry.java
  131. +12 12 org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java
  132. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
  133. +68 271 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
  134. +395 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
  135. +142 9 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java
  136. +185 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
  137. +220 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectStream.java
  138. +70 261 org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java
  139. +0 526 org.eclipse.jgit/src/org/eclipse/jgit/lib/PackFile.java
  140. +0 1,040 org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java
  141. +0 188 org.eclipse.jgit/src/org/eclipse/jgit/lib/PackedObjectLoader.java
  142. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
  143. +12 2 org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
  144. +1 0  org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java
  145. +359 666 org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
  146. +74 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryBuilder.java
  147. +10 3 org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
  148. +0 135 org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryConfig.java
  149. +8 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java
  150. +8 3 org.eclipse.jgit/src/org/eclipse/jgit/lib/Tag.java
  151. +111 0 org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java
  152. +2 4 org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
  153. +0 223 org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java
  154. +0 110 org.eclipse.jgit/src/org/eclipse/jgit/lib/WholePackedObjectLoader.java
  155. +20 15 org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java
  156. +6 3 org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java
  157. +14 9 org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
  158. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
  159. +31 6 org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
  160. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java
  161. +2 1  org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
  162. +1 8 org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java
  163. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java
  164. +67 29 org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
  165. +4 4 org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteTreeFilter.java
  166. +21 24 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/ByteArrayWindow.java
  167. +6 32 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/ByteBufferWindow.java
  168. +4 63 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/ByteWindow.java
  169. +115 14 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/CachedObjectDirectory.java
  170. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/FileBasedConfig.java
  171. +271 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileObjectDatabase.java
  172. +328 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java
  173. +90 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepositoryBuilder.java
  174. +230 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LargePackedDeltaObject.java
  175. +72 22 .../src/org/eclipse/jgit/{lib/DeltaRefPackedObjectLoader.java → storage/file/LargePackedWholeObject.java}
  176. +58 47 ...se.jgit/src/org/eclipse/jgit/{lib/PackOutputStream.java → storage/file/LocalObjectRepresentation.java}
  177. +78 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalObjectToPack.java
  178. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/LockFile.java
  179. +177 55 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/ObjectDirectory.java
  180. +182 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectoryInserter.java
  181. +920 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
  182. +4 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndex.java
  183. +4 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndexV1.java
  184. +4 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndexV2.java
  185. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndexWriter.java
  186. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndexWriterV1.java
  187. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackIndexWriterV2.java
  188. +85 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackInputStream.java
  189. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackLock.java
  190. +3 2 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/PackReverseIndex.java
  191. +37 19 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/RefDirectory.java
  192. +7 2 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/RefDirectoryRename.java
  193. +5 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/RefDirectoryUpdate.java
  194. +5 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/ReflogReader.java
  195. +413 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObject.java
  196. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/UnpackedObjectCache.java
  197. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/WindowCache.java
  198. +3 1 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/WindowCacheConfig.java
  199. +109 32 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/file}/WindowCursor.java
  200. +146 3 org.eclipse.jgit/src/org/eclipse/jgit/{lib → storage/pack}/BinaryDelta.java
  201. +134 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaCache.java
  202. +294 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java
  203. +586 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaIndex.java
  204. +130 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaIndexScanner.java
  205. +341 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaStream.java
  206. +511 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java
  207. +80 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindowEntry.java
  208. +136 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectReuseAsIs.java
  209. +320 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
  210. +93 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java
  211. +213 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackOutputStream.java
  212. +1,442 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java
  213. +90 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/StoredObjectRepresentation.java
  214. +86 0 org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ThreadSafeDeltaCache.java
  215. +7 1 org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
  216. +24 19 org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
  217. +50 42 org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
  218. +37 32 org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
  219. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java
  220. +29 18 org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
  221. +27 13 org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
  222. +29 23 org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
  223. +4 5 org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
  224. +8 18 org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
  225. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java
  226. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
  227. +28 17 org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
  228. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
  229. +3 2 org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
  230. +31 24 org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
  231. +70 76 org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
  232. +6 4 org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
  233. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
  234. +29 13 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
  235. +26 52 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java
  236. +2 2 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java
  237. +3 2 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
  238. +12 1 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java
  239. +37 19 org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
  240. +3 8 org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java
  241. +14 0 org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java
  242. +1 1  org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
  243. +43 9 org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
1  org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -17,6 +17,7 @@ Import-Package: javax.servlet;version="[2.5.0,3.0.0)",
17 17 org.eclipse.jgit.lib;version="[0.9.0,0.10.0)",
18 18 org.eclipse.jgit.nls;version="[0.9.0,0.10.0)",
19 19 org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
  20 + org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
20 21 org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
21 22 org.eclipse.jgit.util;version="[0.9.0,0.10.0)",
22 23 org.eclipse.jgit.util.io;version="[0.9.0,0.10.0)"
4 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java
@@ -53,8 +53,8 @@
53 53 import javax.servlet.http.HttpServletResponse;
54 54
55 55 import org.eclipse.jgit.lib.ObjectDatabase;
56   -import org.eclipse.jgit.lib.ObjectDirectory;
57   -import org.eclipse.jgit.lib.PackFile;
  56 +import org.eclipse.jgit.storage.file.ObjectDirectory;
  57 +import org.eclipse.jgit.storage.file.PackFile;
58 58
59 59 /** Sends the current list of pack files, sorted most recent first. */
60 60 class InfoPacksServlet extends HttpServlet {
49 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
@@ -74,30 +74,35 @@ public void doGet(final HttpServletRequest req,
74 74
75 75 final Repository db = getRepository(req);
76 76 final RevWalk walk = new RevWalk(db);
77   - final RevFlag ADVERTISED = walk.newFlag("ADVERTISED");
  77 + try {
  78 + final RevFlag ADVERTISED = walk.newFlag("ADVERTISED");
78 79
79   - final OutputStreamWriter out = new OutputStreamWriter(
80   - new SmartOutputStream(req, rsp), Constants.CHARSET);
81   - final RefAdvertiser adv = new RefAdvertiser() {
82   - @Override
83   - protected void writeOne(final CharSequence line) throws IOException {
84   - // Whoever decided that info/refs should use a different
85   - // delimiter than the native git:// protocol shouldn't
86   - // be allowed to design this sort of stuff. :-(
87   - out.append(line.toString().replace(' ', '\t'));
88   - }
  80 + final OutputStreamWriter out = new OutputStreamWriter(
  81 + new SmartOutputStream(req, rsp), Constants.CHARSET);
  82 + final RefAdvertiser adv = new RefAdvertiser() {
  83 + @Override
  84 + protected void writeOne(final CharSequence line)
  85 + throws IOException {
  86 + // Whoever decided that info/refs should use a different
  87 + // delimiter than the native git:// protocol shouldn't
  88 + // be allowed to design this sort of stuff. :-(
  89 + out.append(line.toString().replace(' ', '\t'));
  90 + }
89 91
90   - @Override
91   - protected void end() {
92   - // No end marker required for info/refs format.
93   - }
94   - };
95   - adv.init(walk, ADVERTISED);
96   - adv.setDerefTags(true);
  92 + @Override
  93 + protected void end() {
  94 + // No end marker required for info/refs format.
  95 + }
  96 + };
  97 + adv.init(walk, ADVERTISED);
  98 + adv.setDerefTags(true);
97 99
98   - Map<String, Ref> refs = db.getAllRefs();
99   - refs.remove(Constants.HEAD);
100   - adv.send(refs);
101   - out.close();
  100 + Map<String, Ref> refs = db.getAllRefs();
  101 + refs.remove(Constants.HEAD);
  102 + adv.send(refs);
  103 + out.close();
  104 + } finally {
  105 + walk.release();
  106 + }
102 107 }
103 108 }
2  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java
@@ -56,8 +56,8 @@
56 56 import javax.servlet.ServletResponse;
57 57 import javax.servlet.http.HttpServletResponse;
58 58
59   -import org.eclipse.jgit.lib.ObjectDirectory;
60 59 import org.eclipse.jgit.lib.Repository;
  60 +import org.eclipse.jgit.storage.file.ObjectDirectory;
61 61
62 62 /**
63 63 * Requires the target {@link Repository} to be available via local filesystem.
2  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java
@@ -60,8 +60,8 @@
60 60 import javax.servlet.http.HttpServletRequest;
61 61 import javax.servlet.http.HttpServletResponse;
62 62
63   -import org.eclipse.jgit.lib.ObjectDirectory;
64 63 import org.eclipse.jgit.lib.Repository;
  64 +import org.eclipse.jgit.storage.file.ObjectDirectory;
65 65
66 66 /** Sends any object from {@code GIT_DIR/objects/??/0 38}, or any pack file. */
67 67 abstract class ObjectFileServlet extends HttpServlet {
7 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
@@ -83,7 +83,12 @@
83 83 protected void advertise(HttpServletRequest req, Repository db,
84 84 PacketLineOutRefAdvertiser pck) throws IOException,
85 85 ServiceNotEnabledException, ServiceNotAuthorizedException {
86   - receivePackFactory.create(req, db).sendAdvertisedRefs(pck);
  86 + ReceivePack rp = receivePackFactory.create(req, db);
  87 + try {
  88 + rp.sendAdvertisedRefs(pck);
  89 + } finally {
  90 + rp.getRevWalk().release();
  91 + }
87 92 }
88 93 }
89 94
2  org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
@@ -80,6 +80,8 @@ public void doGet(final HttpServletRequest req,
80 80
81 81 private byte[] read(final HttpServletRequest req) throws IOException {
82 82 final File gitdir = getRepository(req).getDirectory();
  83 + if (gitdir == null)
  84 + throw new FileNotFoundException(fileName);
83 85 return IO.readFully(new File(gitdir, fileName));
84 86 }
85 87 }
14 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
@@ -83,7 +83,12 @@
83 83 protected void advertise(HttpServletRequest req, Repository db,
84 84 PacketLineOutRefAdvertiser pck) throws IOException,
85 85 ServiceNotEnabledException, ServiceNotAuthorizedException {
86   - uploadPackFactory.create(req, db).sendAdvertisedRefs(pck);
  86 + UploadPack up = uploadPackFactory.create(req, db);
  87 + try {
  88 + up.sendAdvertisedRefs(pck);
  89 + } finally {
  90 + up.getRevWalk().release();
  91 + }
87 92 }
88 93 }
89 94
@@ -107,7 +112,12 @@ public void doPost(final HttpServletRequest req,
107 112 up.setBiDirectionalPipe(false);
108 113 rsp.setContentType(RSP_TYPE);
109 114
110   - final SmartOutputStream out = new SmartOutputStream(req, rsp);
  115 + final SmartOutputStream out = new SmartOutputStream(req, rsp) {
  116 + @Override
  117 + public void flush() throws IOException {
  118 + doFlush();
  119 + }
  120 + };
111 121 up.upload(getInputStream(req), out, null);
112 122 out.close();
113 123
4 org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/FileResolver.java
@@ -138,8 +138,10 @@ protected boolean isExportOk(HttpServletRequest req, String repositoryName,
138 138 Repository db) throws IOException {
139 139 if (isExportAll())
140 140 return true;
141   - else
  141 + else if (db.getDirectory() != null)
142 142 return new File(db.getDirectory(), "git-daemon-export-ok").exists();
  143 + else
  144 + return false;
143 145 }
144 146
145 147 private static boolean isUnreasonableName(final String name) {
1  org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -29,5 +29,6 @@ Import-Package: javax.servlet;version="[2.5.0,3.0.0)",
29 29 org.eclipse.jgit.junit;version="[0.9.0,0.10.0)",
30 30 org.eclipse.jgit.lib;version="[0.9.0,0.10.0)",
31 31 org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
  32 + org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
32 33 org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
33 34 org.eclipse.jgit.util;version="[0.9.0,0.10.0)"
9 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java
@@ -62,23 +62,24 @@
62 62 import org.eclipse.jgit.lib.NullProgressMonitor;
63 63 import org.eclipse.jgit.lib.ObjectId;
64 64 import org.eclipse.jgit.lib.Repository;
65   -import org.eclipse.jgit.lib.RepositoryConfig;
66 65 import org.eclipse.jgit.revwalk.RevBlob;
67 66 import org.eclipse.jgit.revwalk.RevCommit;
  67 +import org.eclipse.jgit.storage.file.FileBasedConfig;
  68 +import org.eclipse.jgit.storage.file.FileRepository;
68 69 import org.eclipse.jgit.transport.ReceivePack;
69 70 import org.eclipse.jgit.transport.RemoteRefUpdate;
70 71 import org.eclipse.jgit.transport.Transport;
71 72 import org.eclipse.jgit.transport.URIish;
72 73
73 74 public class AdvertiseErrorTest extends HttpTestCase {
74   - private Repository remoteRepository;
  75 + private FileRepository remoteRepository;
75 76
76 77 private URIish remoteURI;
77 78
78 79 protected void setUp() throws Exception {
79 80 super.setUp();
80 81
81   - final TestRepository src = createTestRepository();
  82 + final TestRepository<FileRepository> src = createTestRepository();
82 83 final String srcName = src.getRepository().getDirectory().getName();
83 84
84 85 ServletContextHandler app = server.addContext("/git");
@@ -114,7 +115,7 @@ public ReceivePack create(HttpServletRequest req, Repository db)
114 115 remoteRepository = src.getRepository();
115 116 remoteURI = toURIish(app, srcName);
116 117
117   - RepositoryConfig cfg = remoteRepository.getConfig();
  118 + FileBasedConfig cfg = remoteRepository.getConfig();
118 119 cfg.setBoolean("http", null, "receivepack", true);
119 120 cfg.save();
120 121 }
9 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java
@@ -64,9 +64,10 @@
64 64 import org.eclipse.jgit.lib.NullProgressMonitor;
65 65 import org.eclipse.jgit.lib.ObjectId;
66 66 import org.eclipse.jgit.lib.Repository;
67   -import org.eclipse.jgit.lib.RepositoryConfig;
68 67 import org.eclipse.jgit.revwalk.RevBlob;
69 68 import org.eclipse.jgit.revwalk.RevCommit;
  69 +import org.eclipse.jgit.storage.file.FileBasedConfig;
  70 +import org.eclipse.jgit.storage.file.FileRepository;
70 71 import org.eclipse.jgit.transport.PreReceiveHook;
71 72 import org.eclipse.jgit.transport.PushResult;
72 73 import org.eclipse.jgit.transport.ReceiveCommand;
@@ -76,14 +77,14 @@
76 77 import org.eclipse.jgit.transport.URIish;
77 78
78 79 public class HookMessageTest extends HttpTestCase {
79   - private Repository remoteRepository;
  80 + private FileRepository remoteRepository;
80 81
81 82 private URIish remoteURI;
82 83
83 84 protected void setUp() throws Exception {
84 85 super.setUp();
85 86
86   - final TestRepository src = createTestRepository();
  87 + final TestRepository<FileRepository> src = createTestRepository();
87 88 final String srcName = src.getRepository().getDirectory().getName();
88 89
89 90 ServletContextHandler app = server.addContext("/git");
@@ -124,7 +125,7 @@ public void onPreReceive(ReceivePack rp,
124 125 remoteRepository = src.getRepository();
125 126 remoteURI = toURIish(app, srcName);
126 127
127   - RepositoryConfig cfg = remoteRepository.getConfig();
  128 + FileBasedConfig cfg = remoteRepository.getConfig();
128 129 cfg.setBoolean("http", null, "receivepack", true);
129 130 cfg.save();
130 131 }
17 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
@@ -66,12 +66,13 @@
66 66 import org.eclipse.jgit.lib.RefUpdate;
67 67 import org.eclipse.jgit.lib.Repository;
68 68 import org.eclipse.jgit.revwalk.RevCommit;
  69 +import org.eclipse.jgit.storage.file.FileRepository;
69 70 import org.eclipse.jgit.transport.FetchConnection;
70 71 import org.eclipse.jgit.transport.Transport;
71 72 import org.eclipse.jgit.transport.URIish;
72 73
73 74 public class HttpClientTests extends HttpTestCase {
74   - private TestRepository remoteRepository;
  75 + private TestRepository<FileRepository> remoteRepository;
75 76
76 77 private URIish dumbAuthNoneURI;
77 78
@@ -95,7 +96,7 @@ protected void setUp() throws Exception {
95 96
96 97 server.setUp();
97 98
98   - final String srcName = nameOf(remoteRepository);
  99 + final String srcName = nameOf(remoteRepository.getRepository());
99 100 dumbAuthNoneURI = toURIish(dNone, srcName);
100 101 dumbAuthBasicURI = toURIish(dBasic, srcName);
101 102
@@ -119,10 +120,10 @@ private ServletContextHandler smart(final String path) {
119 120 public Repository open(HttpServletRequest req, String name)
120 121 throws RepositoryNotFoundException,
121 122 ServiceNotEnabledException {
122   - if (!name.equals(nameOf(remoteRepository)))
  123 + final FileRepository db = remoteRepository.getRepository();
  124 + if (!name.equals(nameOf(db)))
123 125 throw new RepositoryNotFoundException(name);
124 126
125   - final Repository db = remoteRepository.getRepository();
126 127 db.incrementOpen();
127 128 return db;
128 129 }
@@ -133,8 +134,8 @@ public Repository open(HttpServletRequest req, String name)
133 134 return ctx;
134 135 }
135 136
136   - private static String nameOf(final TestRepository db) {
137   - return db.getRepository().getDirectory().getName();
  137 + private static String nameOf(final FileRepository db) {
  138 + return db.getDirectory().getName();
138 139 }
139 140
140 141 public void testRepositoryNotFound_Dumb() throws Exception {
@@ -198,7 +199,7 @@ public void testListRemote_Dumb_DetachedHEAD() throws Exception {
198 199 }
199 200
200 201 public void testListRemote_Dumb_NoHEAD() throws Exception {
201   - Repository src = remoteRepository.getRepository();
  202 + FileRepository src = remoteRepository.getRepository();
202 203 File headref = new File(src.getDirectory(), Constants.HEAD);
203 204 assertTrue("HEAD used to be present", headref.delete());
204 205 assertFalse("HEAD is gone", headref.exists());
@@ -306,7 +307,7 @@ public void testListRemote_Smart_UploadPackNeedsAuth() throws Exception {
306 307 }
307 308
308 309 public void testListRemote_Smart_UploadPackDisabled() throws Exception {
309   - Repository src = remoteRepository.getRepository();
  310 + FileRepository src = remoteRepository.getRepository();
310 311 src.getConfig().setBoolean("http", null, "uploadpack", false);
311 312 src.getConfig().save();
312 313
15 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
@@ -79,11 +79,12 @@
79 79 import org.eclipse.jgit.lib.NullProgressMonitor;
80 80 import org.eclipse.jgit.lib.ObjectId;
81 81 import org.eclipse.jgit.lib.Ref;
82   -import org.eclipse.jgit.lib.ReflogReader;
83 82 import org.eclipse.jgit.lib.Repository;
84   -import org.eclipse.jgit.lib.RepositoryConfig;
85 83 import org.eclipse.jgit.revwalk.RevBlob;
86 84 import org.eclipse.jgit.revwalk.RevCommit;
  85 +import org.eclipse.jgit.storage.file.FileBasedConfig;
  86 +import org.eclipse.jgit.storage.file.FileRepository;
  87 +import org.eclipse.jgit.storage.file.ReflogReader;
87 88 import org.eclipse.jgit.transport.FetchConnection;
88 89 import org.eclipse.jgit.transport.HttpTransport;
89 90 import org.eclipse.jgit.transport.RemoteRefUpdate;
@@ -94,7 +95,7 @@
94 95 public class SmartClientSmartServerTest extends HttpTestCase {
95 96 private static final String HDR_TRANSFER_ENCODING = "Transfer-Encoding";
96 97
97   - private Repository remoteRepository;
  98 + private FileRepository remoteRepository;
98 99
99 100 private URIish remoteURI;
100 101
@@ -107,7 +108,7 @@
107 108 protected void setUp() throws Exception {
108 109 super.setUp();
109 110
110   - final TestRepository src = createTestRepository();
  111 + final TestRepository<FileRepository> src = createTestRepository();
111 112 final String srcName = src.getRepository().getDirectory().getName();
112 113
113 114 ServletContextHandler app = server.addContext("/git");
@@ -489,10 +490,10 @@ public void testPush_CreateBranch() throws Exception {
489 490 }
490 491
491 492 public void testPush_ChunkedEncoding() throws Exception {
492   - final TestRepository src = createTestRepository();
  493 + final TestRepository<FileRepository> src = createTestRepository();
493 494 final RevBlob Q_bin = src.blob(new TestRng("Q").nextBytes(128 * 1024));
494 495 final RevCommit Q = src.commit().add("Q", Q_bin).create();
495   - final Repository db = src.getRepository();
  496 + final FileRepository db = src.getRepository();
496 497 final String dstName = Constants.R_HEADS + "new.branch";
497 498 Transport t;
498 499
@@ -547,7 +548,7 @@ public void testPush_ChunkedEncoding() throws Exception {
547 548 }
548 549
549 550 private void enableReceivePack() throws IOException {
550   - final RepositoryConfig cfg = remoteRepository.getConfig();
  551 + final FileBasedConfig cfg = remoteRepository.getConfig();
551 552 cfg.setBoolean("http", null, "receivepack", true);
552 553 cfg.save();
553 554 }
6 org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/util/HttpTestCase.java
@@ -61,6 +61,7 @@
61 61 import org.eclipse.jgit.lib.Repository;
62 62 import org.eclipse.jgit.revwalk.RevCommit;
63 63 import org.eclipse.jgit.revwalk.RevObject;
  64 +import org.eclipse.jgit.storage.file.FileRepository;
64 65 import org.eclipse.jgit.transport.RefSpec;
65 66 import org.eclipse.jgit.transport.RemoteRefUpdate;
66 67 import org.eclipse.jgit.transport.URIish;
@@ -82,8 +83,9 @@ protected void tearDown() throws Exception {
82 83 super.tearDown();
83 84 }
84 85
85   - protected TestRepository createTestRepository() throws Exception {
86   - return new TestRepository(createBareRepository());
  86 + protected TestRepository<FileRepository> createTestRepository()
  87 + throws IOException {
  88 + return new TestRepository<FileRepository>(createBareRepository());
87 89 }
88 90
89 91 protected URIish toURIish(String path) throws URISyntaxException {
1  org.eclipse.jgit.iplog/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Import-Package: org.eclipse.jgit.diff;version="[0.9.0,0.10.0)",
15 15 org.eclipse.jgit.revplot;version="[0.9.0,0.10.0)",
16 16 org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
17 17 org.eclipse.jgit.revwalk.filter;version="[0.9.0,0.10.0)",
  18 + org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
18 19 org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
19 20 org.eclipse.jgit.treewalk;version="[0.9.0,0.10.0)",
20 21 org.eclipse.jgit.treewalk.filter;version="[0.9.0,0.10.0)",
18 org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
@@ -78,15 +78,13 @@
78 78 import org.eclipse.jgit.diff.MyersDiff;
79 79 import org.eclipse.jgit.diff.RawText;
80 80 import org.eclipse.jgit.errors.ConfigInvalidException;
81   -import org.eclipse.jgit.errors.MissingObjectException;
82 81 import org.eclipse.jgit.iplog.Committer.ActiveRange;
83 82 import org.eclipse.jgit.lib.BlobBasedConfig;
84 83 import org.eclipse.jgit.lib.Constants;
85 84 import org.eclipse.jgit.lib.MutableObjectId;
86   -import org.eclipse.jgit.lib.ObjectLoader;
  85 +import org.eclipse.jgit.lib.ObjectReader;
87 86 import org.eclipse.jgit.lib.PersonIdent;
88 87 import org.eclipse.jgit.lib.Repository;
89   -import org.eclipse.jgit.lib.WindowCursor;
90 88 import org.eclipse.jgit.revwalk.RevCommit;
91 89 import org.eclipse.jgit.revwalk.RevTree;
92 90 import org.eclipse.jgit.revwalk.RevWalk;
@@ -144,7 +142,7 @@
144 142
145 143 private NameConflictTreeWalk tw;
146 144
147   - private final WindowCursor curs = new WindowCursor();
  145 + private ObjectReader curs;
148 146
149 147 private final MutableObjectId idbuf = new MutableObjectId();
150 148
@@ -184,8 +182,9 @@ public void scan(Repository repo, RevCommit startCommit, String version)
184 182 throws IOException, ConfigInvalidException {
185 183 try {
186 184 db = repo;
187   - rw = new RevWalk(db);
188   - tw = new NameConflictTreeWalk(db);
  185 + curs = db.newObjectReader();
  186 + rw = new RevWalk(curs);
  187 + tw = new NameConflictTreeWalk(curs);
189 188
190 189 RevCommit c = rw.parseCommit(startCommit);
191 190
@@ -194,7 +193,7 @@ public void scan(Repository repo, RevCommit startCommit, String version)
194 193 scanProjectCommits(meta.getProjects().get(0), c);
195 194 commits.add(c);
196 195 } finally {
197   - WindowCursor.release(curs);
  196 + curs.release();
198 197 db = null;
199 198 rw = null;
200 199 tw = null;
@@ -417,10 +416,7 @@ private void scanProjectCommits(Project proj, RevCommit start)
417 416
418 417 private byte[] openBlob(int side) throws IOException {
419 418 tw.getObjectId(idbuf, side);
420   - ObjectLoader ldr = db.openObject(curs, idbuf);
421   - if (ldr == null)
422   - throw new MissingObjectException(idbuf.copy(), Constants.OBJ_BLOB);
423   - return ldr.getCachedBytes();
  419 + return curs.open(idbuf, Constants.OBJ_BLOB).getCachedBytes();
424 420 }
425 421
426 422 /**
4 org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java
@@ -58,9 +58,9 @@
58 58 import org.eclipse.jgit.errors.ConfigInvalidException;
59 59 import org.eclipse.jgit.lib.Config;
60 60 import org.eclipse.jgit.lib.Constants;
61   -import org.eclipse.jgit.lib.FileBasedConfig;
62   -import org.eclipse.jgit.lib.LockFile;
63 61 import org.eclipse.jgit.lib.ObjectId;
  62 +import org.eclipse.jgit.storage.file.FileBasedConfig;
  63 +import org.eclipse.jgit.storage.file.LockFile;
64 64
65 65 /**
66 66 * Manages the {@code .eclipse_iplog} file in a project.
2  org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -18,6 +18,8 @@ Import-Package: junit.framework;version="[3.8.2,4.0.0)",
18 18 org.eclipse.jgit.revplot;version="[0.9.0,0.10.0)",
19 19 org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
20 20 org.eclipse.jgit.revwalk.filter;version="[0.9.0,0.10.0)",
  21 + org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
  22 + org.eclipse.jgit.storage.pack;version="[0.9.0,0.10.0)",
21 23 org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
22 24 org.eclipse.jgit.treewalk;version="[0.9.0,0.10.0)",
23 25 org.eclipse.jgit.treewalk.filter;version="[0.9.0,0.10.0)",
17 org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -62,12 +62,13 @@
62 62
63 63 import org.eclipse.jgit.lib.AnyObjectId;
64 64 import org.eclipse.jgit.lib.Constants;
65   -import org.eclipse.jgit.lib.FileBasedConfig;
66 65 import org.eclipse.jgit.lib.PersonIdent;
67 66 import org.eclipse.jgit.lib.Repository;
68 67 import org.eclipse.jgit.lib.RepositoryCache;
69   -import org.eclipse.jgit.lib.WindowCache;
70   -import org.eclipse.jgit.lib.WindowCacheConfig;
  68 +import org.eclipse.jgit.storage.file.FileBasedConfig;
  69 +import org.eclipse.jgit.storage.file.FileRepository;
  70 +import org.eclipse.jgit.storage.file.WindowCache;
  71 +import org.eclipse.jgit.storage.file.WindowCacheConfig;
71 72 import org.eclipse.jgit.util.IO;
72 73 import org.eclipse.jgit.util.SystemReader;
73 74
@@ -259,7 +260,7 @@ private static void reportDeleteFailure(final String testName,
259 260 * @throws IOException
260 261 * the repository could not be created in the temporary area
261 262 */
262   - protected Repository createBareRepository() throws IOException {
  263 + protected FileRepository createBareRepository() throws IOException {
263 264 return createRepository(true /* bare */);
264 265 }
265 266
@@ -270,7 +271,7 @@ protected Repository createBareRepository() throws IOException {
270 271 * @throws IOException
271 272 * the repository could not be created in the temporary area
272 273 */
273   - protected Repository createWorkRepository() throws IOException {
  274 + protected FileRepository createWorkRepository() throws IOException {
274 275 return createRepository(false /* not bare */);
275 276 }
276 277
@@ -284,11 +285,11 @@ protected Repository createWorkRepository() throws IOException {
284 285 * @throws IOException
285 286 * the repository could not be created in the temporary area
286 287 */
287   - private Repository createRepository(boolean bare) throws IOException {
  288 + private FileRepository createRepository(boolean bare) throws IOException {
288 289 String uniqueId = System.currentTimeMillis() + "_" + (testCount++);
289 290 String gitdirName = "test" + uniqueId + (bare ? "" : "/") + Constants.DOT_GIT;
290 291 File gitdir = new File(trash, gitdirName).getCanonicalFile();
291   - Repository db = new Repository(gitdir);
  292 + FileRepository db = new FileRepository(gitdir);
292 293
293 294 assertFalse(gitdir.exists());
294 295 db.create();
@@ -323,7 +324,7 @@ protected int runHook(final Repository db, final File hook,
323 324 putPersonIdent(env, "AUTHOR", author);
324 325 putPersonIdent(env, "COMMITTER", committer);
325 326
326   - final File cwd = db.getWorkDir();
  327 + final File cwd = db.getWorkTree();
327 328 final Process p = Runtime.getRuntime().exec(argv, toEnvArray(env), cwd);
328 329 p.getOutputStream().close();
329 330 p.getErrorStream().close();
2  org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
@@ -52,7 +52,7 @@
52 52
53 53 import org.eclipse.jgit.errors.ConfigInvalidException;
54 54 import org.eclipse.jgit.lib.Constants;
55   -import org.eclipse.jgit.lib.FileBasedConfig;
  55 +import org.eclipse.jgit.storage.file.FileBasedConfig;
56 56 import org.eclipse.jgit.util.FS;
57 57 import org.eclipse.jgit.util.SystemReader;
58 58
183 org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -73,22 +73,16 @@
73 73 import org.eclipse.jgit.lib.Commit;
74 74 import org.eclipse.jgit.lib.Constants;
75 75 import org.eclipse.jgit.lib.FileMode;
76   -import org.eclipse.jgit.lib.LockFile;
77 76 import org.eclipse.jgit.lib.NullProgressMonitor;
78 77 import org.eclipse.jgit.lib.ObjectChecker;
79   -import org.eclipse.jgit.lib.ObjectDatabase;
80   -import org.eclipse.jgit.lib.ObjectDirectory;
81 78 import org.eclipse.jgit.lib.ObjectId;
82   -import org.eclipse.jgit.lib.ObjectWriter;
83   -import org.eclipse.jgit.lib.PackFile;
84   -import org.eclipse.jgit.lib.PackWriter;
  79 +import org.eclipse.jgit.lib.ObjectInserter;
85 80 import org.eclipse.jgit.lib.PersonIdent;
86 81 import org.eclipse.jgit.lib.Ref;
87 82 import org.eclipse.jgit.lib.RefUpdate;
88 83 import org.eclipse.jgit.lib.RefWriter;
89 84 import org.eclipse.jgit.lib.Repository;
90 85 import org.eclipse.jgit.lib.Tag;
91   -import org.eclipse.jgit.lib.PackIndex.MutableEntry;
92 86 import org.eclipse.jgit.revwalk.ObjectWalk;
93 87 import org.eclipse.jgit.revwalk.RevBlob;
94 88 import org.eclipse.jgit.revwalk.RevCommit;
@@ -96,11 +90,22 @@
96 90 import org.eclipse.jgit.revwalk.RevTag;
97 91 import org.eclipse.jgit.revwalk.RevTree;
98 92 import org.eclipse.jgit.revwalk.RevWalk;
  93 +import org.eclipse.jgit.storage.file.FileRepository;
  94 +import org.eclipse.jgit.storage.file.LockFile;
  95 +import org.eclipse.jgit.storage.file.ObjectDirectory;
  96 +import org.eclipse.jgit.storage.file.PackFile;
  97 +import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
  98 +import org.eclipse.jgit.storage.pack.PackWriter;
99 99 import org.eclipse.jgit.treewalk.TreeWalk;
100 100 import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
101 101
102   -/** Wrapper to make creating test data easier. */
103   -public class TestRepository {
  102 +/**
  103 + * Wrapper to make creating test data easier.
  104 + *
  105 + * @param <R>
  106 + * type of Repository the test data is stored on.
  107 + */
  108 +public class TestRepository<R extends Repository> {
104 109 private static final PersonIdent author;
105 110
106 111 private static final PersonIdent committer;
@@ -119,11 +124,11 @@
119 124 committer = new PersonIdent(cn, ce, now, tz);
120 125 }
121 126
122   - private final Repository db;
  127 + private final R db;
123 128
124 129 private final RevWalk pool;
125 130
126   - private final ObjectWriter writer;
  131 + private final ObjectInserter inserter;
127 132
128 133 private long now;
129 134
@@ -132,9 +137,9 @@
132 137 *
133 138 * @param db
134 139 * the test repository to write into.
135   - * @throws Exception
  140 + * @throws IOException
136 141 */
137   - public TestRepository(Repository db) throws Exception {
  142 + public TestRepository(R db) throws IOException {
138 143 this(db, new RevWalk(db));
139 144 }
140 145
@@ -145,17 +150,17 @@ public TestRepository(Repository db) throws Exception {
145 150 * the test repository to write into.
146 151 * @param rw
147 152 * the RevObject pool to use for object lookup.
148   - * @throws Exception
  153 + * @throws IOException
149 154 */
150   - public TestRepository(Repository db, RevWalk rw) throws Exception {
  155 + public TestRepository(R db, RevWalk rw) throws IOException {
151 156 this.db = db;
152 157 this.pool = rw;
153   - this.writer = new ObjectWriter(db);
  158 + this.inserter = db.newObjectInserter();
154 159 this.now = 1236977987000L;
155 160 }
156 161
157 162 /** @return the repository this helper class operates against. */
158   - public Repository getRepository() {
  163 + public R getRepository() {
159 164 return db;
160 165 }
161 166
@@ -200,7 +205,14 @@ public RevBlob blob(final String content) throws Exception {
200 205 * @throws Exception
201 206 */
202 207 public RevBlob blob(final byte[] content) throws Exception {
203   - return pool.lookupBlob(writer.writeBlob(content));
  208 + ObjectId id;
  209 + try {
  210 + id = inserter.insert(Constants.OBJ_BLOB, content);
  211 + inserter.flush();
  212 + } finally {
  213 + inserter.release();
  214 + }
  215 + return pool.lookupBlob(id);
204 216 }
205 217
206 218 /**
@@ -236,7 +248,14 @@ public RevTree tree(final DirCacheEntry... entries) throws Exception {
236 248 for (final DirCacheEntry e : entries)
237 249 b.add(e);
238 250 b.finish();
239   - return pool.lookupTree(dc.writeTree(writer));
  251 + ObjectId root;
  252 + try {
  253 + root = dc.writeTree(inserter);
  254 + inserter.flush();
  255 + } finally {
  256 + inserter.release();
  257 + }
  258 + return pool.lookupTree(root);
240 259 }
241 260
242 261 /**
@@ -253,7 +272,7 @@ public RevTree tree(final DirCacheEntry... entries) throws Exception {
253 272 */
254 273 public RevObject get(final RevTree tree, final String path)
255 274 throws AssertionFailedError, Exception {
256   - final TreeWalk tw = new TreeWalk(db);
  275 + final TreeWalk tw = new TreeWalk(pool.getObjectReader());
257 276 tw.setFilter(PathFilterGroup.createFromStrings(Collections
258 277 .singleton(path)));
259 278 tw.reset(tree);
@@ -346,7 +365,14 @@ public RevCommit commit(final int secDelta, final RevTree tree,
346 365 c.setAuthor(new PersonIdent(author, new Date(now)));
347 366 c.setCommitter(new PersonIdent(committer, new Date(now)));
348 367 c.setMessage("");
349   - return pool.lookupCommit(writer.writeCommit(c));
  368 + ObjectId id;
  369 + try {
  370 + id = inserter.insert(Constants.OBJ_COMMIT, inserter.format(c));
  371 + inserter.flush();
  372 + } finally {
  373 + inserter.release();
  374 + }
  375 + return pool.lookupCommit(id);
350 376 }
351 377
352 378 /** @return a new commit builder. */
@@ -377,7 +403,14 @@ public RevTag tag(final String name, final RevObject dst) throws Exception {
377 403 t.setTag(name);
378 404 t.setTagger(new PersonIdent(committer, new Date(now)));
379 405 t.setMessage("");
380   - return (RevTag) pool.lookupAny(writer.writeTag(t), Constants.OBJ_TAG);
  406 + ObjectId id;
  407 + try {
  408 + id = inserter.insert(Constants.OBJ_TAG, inserter.format(t));
  409 + inserter.flush();
  410 + } finally {
  411 + inserter.release();
  412 + }
  413 + return (RevTag) pool.lookupAny(id, Constants.OBJ_TAG);
381 414 }
382 415
383 416 /**
@@ -443,25 +476,27 @@ public RevCommit update(String ref, CommitBuilder to) throws Exception {
443 476 * @throws Exception
444 477 */
445 478 public void updateServerInfo() throws Exception {
446   - final ObjectDatabase odb = db.getObjectDatabase();
447   - if (odb instanceof ObjectDirectory) {
448   - RefWriter rw = new RefWriter(db.getAllRefs().values()) {
  479 + if (db instanceof FileRepository) {
  480 + final FileRepository fr = (FileRepository) db;
  481 + RefWriter rw = new RefWriter(fr.getAllRefs().values()) {
449 482 @Override
450 483 protected void writeFile(final String name, final byte[] bin)
451 484 throws IOException {
452   - TestRepository.this.writeFile(name, bin);
  485 + File path = new File(fr.getDirectory(), name);
  486 + TestRepository.this.writeFile(path, bin);
453 487 }
454 488 };
455 489 rw.writePackedRefs();
456 490 rw.writeInfoRefs();
457 491
458 492 final StringBuilder w = new StringBuilder();
459   - for (PackFile p : ((ObjectDirectory) odb).getPacks()) {
  493 + for (PackFile p : fr.getObjectDatabase().getPacks()) {
460 494 w.append("P ");
461 495 w.append(p.getPackFile().getName());
462 496 w.append('\n');
463 497 }
464   - writeFile("objects/info/packs", Constants.encodeASCII(w.toString()));
  498 + writeFile(new File(new File(fr.getObjectDatabase().getDirectory(),
  499 + "info"), "packs"), Constants.encodeASCII(w.toString()));
465 500 }
466 501 }
467 502
@@ -528,7 +563,7 @@ public void fsck(RevObject... tips) throws MissingObjectException,
528 563 if (o == null)
529 564 break;
530 565
531   - final byte[] bin = db.openObject(o).getCachedBytes();
  566 + final byte[] bin = db.open(o, o.getType()).getCachedBytes();
532 567 oc.checkCommit(bin);
533 568 assertHash(o, bin);
534 569 }
@@ -538,7 +573,7 @@ public void fsck(RevObject... tips) throws MissingObjectException,
538 573 if (o == null)
539 574 break;
540 575
541   - final byte[] bin = db.openObject(o).getCachedBytes();
  576 + final byte[] bin = db.open(o, o.getType()).getCachedBytes();
542 577 oc.check(o.getType(), bin);
543 578 assertHash(o, bin);
544 579 }
@@ -563,38 +598,46 @@ private static void assertHash(RevObject id, byte[] bin) {
563 598 * @throws Exception
564 599 */
565 600 public void packAndPrune() throws Exception {
566   - final ObjectDirectory odb = (ObjectDirectory) db.getObjectDatabase();
567   - final PackWriter pw = new PackWriter(db, NullProgressMonitor.INSTANCE);
568   -
569   - Set<ObjectId> all = new HashSet<ObjectId>();
570   - for (Ref r : db.getAllRefs().values())
571   - all.add(r.getObjectId());
572   - pw.preparePack(all, Collections.<ObjectId> emptySet());
573   -
574   - final ObjectId name = pw.computeName();
575   - OutputStream out;
576   -
577   - final File pack = nameFor(odb, name, ".pack");
578   - out = new BufferedOutputStream(new FileOutputStream(pack));
579   - try {
580   - pw.writePack(out);
581   - } finally {
582   - out.close();
583   - }
584   - pack.setReadOnly();
  601 + if (db.getObjectDatabase() instanceof ObjectDirectory) {
  602 + ObjectDirectory odb = (ObjectDirectory) db.getObjectDatabase();
  603 + NullProgressMonitor m = NullProgressMonitor.INSTANCE;
  604 +
  605 + final File pack, idx;
  606 + PackWriter pw = new PackWriter(db);
  607 + try {
  608 + Set<ObjectId> all = new HashSet<ObjectId>();
  609 + for (Ref r : db.getAllRefs().values())
  610 + all.add(r.getObjectId());
  611 + pw.preparePack(m, all, Collections.<ObjectId> emptySet());
  612 +
  613 + final ObjectId name = pw.computeName();
  614 + OutputStream out;
  615 +
  616 + pack = nameFor(odb, name, ".pack");
  617 + out = new BufferedOutputStream(new FileOutputStream(pack));
  618 + try {
  619 + pw.writePack(m, m, out);
  620 + } finally {
  621 + out.close();