aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes
Commit message (Collapse)AuthorAgeFilesLines
* Update EDL 1.0 license headers to new short SPDX compliant formatMatthias Sohn2020-01-044-152/+20
| | | | | | | | | | This is the format given by the Eclipse legal doc generator [1]. [1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit Bug: 548298 Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-203-3/+3
| | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* NoteMapTest: Add missing @Test annotationsDave Borowitz2016-08-261-1/+7
| | | | | | | | | | The RepositoryTestCase hierarchy no longer comes from TestCase, so all test methods must have @Test. Fix one test that was broken but never run; fortunately this was just a typo in the test code. Change-Id: I3ac8ccdab5e2d5539c63d7b0a88d8bdb0c5ff66e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* NoteMapTest: Open TreeWalk instances in try-with-resourceDavid Pursehouse2016-02-121-8/+12
| | | | | Change-Id: I70da0140fe087e7e69c28e9ddd125495d916ec1b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* Replace deprecated release() methods by close()Matthias Sohn2015-05-213-6/+6
| | | | | | | | See the discussion [1] in the Gerrit mailing list. [1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move base test classes to the junit bundle for reuse for Java 7 testsRobin Rosenberg2013-02-043-3/+3
| | | | Change-Id: Iedb54eb9d8396bc3ae66d8754c1527fd9ca655f9
* Add shortening of note ref names to NoteMapKevin Sawicki2011-05-231-0/+8
| | | | | Change-Id: I224190bbb41c7cbea38388d0148ecc6dc68f3a14 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Exposed the constructor of Note classSasa Zivkov2011-01-251-58/+58
| | | | | | | | | | | | | | | Additionally, defined the NoteMap.getNote method which returns a Note instance. These changes were necessary to enable implementation of the NoteMerger interface (the merge method needs to instantiate a Note) and to enable direct use of NoteMerger which expects instances of Note class as its paramters. Implementing creation of code review summary notes in Gerrit [1] will make use of both of these features. [1] https://review.source.android.com/#change,20045 Change-Id: I627aefcedcd3434deecd63fa1d3e90e303b385ac Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merging Git notesSasa Zivkov2011-01-092-0/+658
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging Git notes branches has several differences from merging "normal" branches. Although Git notes are initially stored as one flat tree the tree may fanout when the number of notes becomes too large for efficient access. In this case the first two hex digits of the note name will be used as a subdirectory name and the rest 38 hex digits as the file name under that directory. Similarly, when number of notes decreases a fanout tree may collapse back into a flat tree. The Git notes merge algorithm must take into account possibly different tree structures in different note branches and must properly match them against each other. Any conflict on a Git note is, by default, resolved by concatenating the two conflicting versions of the note. A delete-edit conflict is, by default, resolved by keeping the edit version. The note merge logic is pluggable and the caller may provide custom note merger that will perform different merging strategy. Additionally, it is possible to have non-note entries inside a notes tree. The merge algorithm must also take this fact into account and will try to merge such non-note entries. However, in case of any merge conflicts the merge operation will fail. Git notes merge algorithm is currently not trying to do content merge of non-note entries. Thanks to Shawn Pearce for patiently answering my questions related to this topic, giving hints and providing code snippets. Change-Id: I3b2335c76c766fd7ea25752e54087f9b19d69c88 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* NoteMap implements Iterable<Note>Sasa Zivkov2011-01-051-0/+87
| | | | | | | | | We will need to iterate over all notes of a NoteMap, at least this will be needed for testing purposes. This change also implied making the Note class public. Change-Id: I9b0639f9843f457ee9de43504b2499a673cd0e77 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
* Convert all JGit unit tests to JUnit 4Robin Rosenberg2010-12-312-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eclipse has some problem re-running single JUnit tests if the tests are in Junit 3 format, but the JUnit 4 launcher is used. This was quite unnecessary and the move was not completed. We still have no JUnit4 test. This completes the extermination of JUnit3. Most of the work was global searce/replace using regular expression, followed by numerous invocarions of quick-fix and organize imports and verification that we had the same number of tests before and after. - Annotations were introduced. - All references to JUnit3 classes removed - Half-good replacement for getting the test name. This was needed to make the TestRngs work. The initialization of TestRngs was also made lazily since we can not longer find out the test name in runtime in the @Before methods. - Renamed test classes to end with Test, with the exception of TestTranslateBundle, which fails from Maven - Moved JGitTestUtil to the junit support bundle Change-Id: Iddcd3da6ca927a7be773a9c63ebf8bb2147e2d13 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Split note leaf buckets at 256 elementsShawn O. Pearce2010-11-121-0/+41
| | | | | | | | | | | | | Leaf level notes trees are split into a new fan-out tree if an insertion occurs and the tree already contains >= 256 notes in it. The splitting may occur multiple times if all of the notes have the same prefix; in the worst case this produces a tree path such as "00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/be" if all of the notes begin with zeros. Change-Id: I2d7d98f35108def9ec49936ddbdc34b13822a3c7 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Allow writing a NoteMap back to the repositoryShawn O. Pearce2010-11-121-0/+106
| | | | | | | | This is necessary to allow applications to wrap the note tree in a commit and update the note branch with the new state. Change-Id: Idbd7ead4a1b16ae2b64a30a4a01a29cfed548cdf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add in-memory updating support to NoteMapShawn O. Pearce2010-11-122-0/+325
| | | | | | | | | | NoteMap now supports editing in-memory, allowing applications to modify the NoteMap once it has been loaded from the branch. The ability to write the branch back to tree objects is not yet done, so the edits are strictly transient. Change-Id: I63448954abfca2a8e3e95369cd84c0d1176cdb79 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Define NoteMap, a simple note tree readerShawn O. Pearce2010-11-111-0/+201
The NoteMap makes it easy to read a small notes tree as created by the `git notes` command in C Git. To make the initial implementation simple a notes tree is read recursively into a map in memory. This is reasonable if the application will need to access all notes, or if there are less than 256 notes in the tree, but doesn't behave well when the number of notes exceeds 256 and the application doesn't need to access all of them. We can later add support for lazily loading different subpaths, thus fixing the large note tree problem described above. Currently the implementation only supports reading. Writing notes is more complex because trees need to be expanded or collapsed at the exact 256 entry cut-off in order to retain the same tree SHA-1 that C Git would use for the same content. It also needs to retain non-note tree entries such as ".gitignore" or ".gitattribute" files that might randomly appear within a notes tree. We can also add writing support later. Change-Id: I93704bd84ebf650d51de34da3f1577ef0f7a9144 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>