summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge changes I6543c2e1,I21ed029dTerry Parker2020-05-112-0/+259
|\ \ | | | | | | | | | | | | | | | * changes: ReceivePack: adding IterativeConnectivityChecker Moving transport/internal -> internal/transport
| * | ReceivePack: adding IterativeConnectivityCheckerDemetr Starshov2020-05-082-0/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an IterativeConnectivityChecker which runs a connectivity check with a filtered set of references, and falls back to using the full set of advertised references. It uses references during first check attempt: - References that are ancestors of an incoming commits (e.g., pushing a commit onto an existing branch or pushing a new branch based on another branch) - Additional list of references we know client can be interested in (e.g. list of open changes for Gerrit) We tested it inside Google and it improves connectivity for certain topologies. For example connectivity counts for chromium.googlesource.com/chromium/src: percentile_50: 1923 (was: 22777) percentile_90: 23272 (was: 353003) percentile_99: 345522 (was: 353435) This saved ~2 seconds on every push to this repository. Signed-off-by: Demetr Starshov <dstarshov@google.com> Change-Id: I6543c2e10ed04622ca795b195665133e690d3b10
* | | Fix error occurring during checkoutNail Samatov2020-05-071-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix NullPointerException occurring when calling CheckoutCommand with forced == true option when the branch isn't changed and there is deleted uncommitted file. Change-Id: I99bf1fc25e6889f07092320d7bc2772ec5d341b5 Signed-off-by: Nail Samatov <sanail@yandex.ru>
* | | Apply hunks when renaming or copying from patch filesJack Wickham2020-05-067-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | When applying a patch that contains renames or copies using ApplyCommand, also apply all hunks that apply to the renamed or copied file. Change-Id: I9f3fa4370458bd7c14beeb2e2b49e846d70203cb Signed-off-by: Jack Wickham <jwickham@palantir.com>
* | | Create parent directories when renaming a file in ApplyCommandJack Wickham2020-05-064-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, applying a patch will fail if the destination directory doesn't exist; after, the necessary parent directories are created. If renaming the file fails, the directories won't be deleted, so this change isn't atomic. However, ApplyCommand is already not atomic - if one hunk fails to apply, other hunks still get applied - so I don't think that is a blocker. Change-Id: Iea36138b806d4e7012176615bcc673756a82f365 Signed-off-by: Jack Wickham <jwickham@palantir.com>
* | | Add missing test source file to the buildDavid Ostrovsky2020-05-031-0/+1
|/ / | | | | | | | | Change-Id: I020ff281eaa49794aeb1853711485bc8c7047dd8 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | revwalk: Introduce bitmap-based object reachability checkerIvan Frade2020-04-281-0/+31
| | | | | | | | | | Change-Id: I0b1a2bd21f98894862aab339f8c2e4a417897b89 Signed-off-by: Ivan Frade <ifrade@google.com>
* | revwalk: Extract ObjectReachabilityChecker interfaceIvan Frade2020-04-282-135/+146
| | | | | | | | | | | | | | | | | | | | Extract ObjectReachabilityChecker interface from the walk-based implementation, to add a bitmapped based implementation later. Refactor the test case to use it for both implementations. Change-Id: Iaac7c6b037723811956ac22625f27d3b4d742139 Signed-off-by: Ivan Frade <ifrade@google.com>
* | UploadPack: Extract walk-based reachability checkIvan Frade2020-04-281-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparing the code to optimize the bitmap-based object reachability checker. We are mirroring first the commit reachability checker structure (interface + 2 implementations). Move the walk-base reachability checker to its own class. This class is public at the moment. Later ObjectWalk will return an interface and this implementation will be package-private. Change-Id: Ifac70094e1af137291c3607d95e689992f814b26 Signed-off-by: Ivan Frade <ifrade@google.com>
* | UploadPack: Clear advertised ref map after negotiationMinh Thai2020-04-231-0/+78
|/ | | | | | | | | | | After negotiation phase of a fetch, the advertised ref map is no longer used and can be safely cleared. For >1GiB repos object selection and packfile writing may take 10s of minutes. For the chromium.googlesource.com/chromium/src repo, this advertised ref map is >400MiB. Returning this memory to the Java heap is a major scalability win. Change-Id: I00d453c5ef47630c21f199e333e1cfcf47b7e92a Signed-off-by: Minh Thai <mthai@google.com>
* Fix human name for local .bundle filesKonrad Windszus2020-04-211-0/+11
| | | | | | Bug: 560903 Change-Id: I15d45330398cc573940265d16a2db29ddce085aa Signed-off-by: Konrad Windszus <konrad_w@gmx.de>
* Merge branch 'stable-5.7'Matthias Sohn2020-04-182-0/+5
|\ | | | | | | | | | | | | | | * stable-5.7: Bazel: Disable SecurityManagerMissingPermissionsTest test Change-Id: Id8665d1ba630c1359e86846548143a785b178e75 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Bazel: Disable SecurityManagerMissingPermissionsTest testDavid Ostrovsky2020-04-182-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Id5376f09f0d a test with dependency on log4j library was added, but the library was missed to be added to the Bazel build tool chain. Given that Bazel test runner doesn't suport custom security manager the test wouldn't pass even if the missing dependency would be added. The only solution we have for now is to exclude that test from Bazel tool chain. Filed a feature request for bazel to support such tests at https://github.com/bazelbuild/bazel/issues/11146 Bug: 562274 Change-Id: I873a0e09addc583455b68122f66cd3952e485f0e Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Scan through all merged reftables for max/min update indicesMinh Thai2020-04-051-0/+117
| | | | | | | | | | | | | | | | Since reftables might have update index ranges that are overlapped. Change-Id: I8f8215b99a0a978d4dd0155dbaf33e5e06ea8202 Signed-off-by: Minh Thai <mthai@google.com> (cherry picked from commit 06748c205c44bb4eaf6015387112de97f566c6a2)
* | FileUtils: improve delete (Windows)Alexander Nittka2020-04-031-0/+37
| | | | | | | | | | | | | | Ensure files are writable before trying to delete them. Bug: 408846 Change-Id: I930a547594bba853c33634ae54bd64d236afade3 Signed-off-by: Alexander Nittka <alex@nittka.de>
* | Merge branch 'stable-5.7'Thomas Wolf2020-04-033-9/+90
|\| | | | | | | | | | | | | | | | | | | * stable-5.7: FS.runInShell(): handle quoted filters and hooksPath containing blanks Handle non-normalized index also for executable files Prepare 5.7.1-SNAPSHOT builds JGit v5.7.0.202003110725-r Change-Id: I8a8580e44bfa05989d476cf22a029abd4fd407c6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * Merge branch 'stable-5.6' into stable-5.7Thomas Wolf2020-04-033-9/+90
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-5.6: FS.runInShell(): handle quoted filters and hooksPath containing blanks Handle non-normalized index also for executable files Change-Id: I240377e87c073ee7a621a88e39fc319c59fa037a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | * FS.runInShell(): handle quoted filters and hooksPath containing blanksThomas Wolf2020-04-031-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 2323d7a. Using $0 in the shell command call results in the command string being taken literally. That was introduced to fix a problem with backslashes, but is actually not correct. First, the problem with backslashes occurred only on Win32/Cygwin, and has been properly fixed in commit 6f268f8. Second, this is used only for hooks (which don't have backslashes in their names) and filter commands from the git config, where the user is responsible for properly quoting or escaping such that the commands work. Third, using $0 actually breaks correctly quoted filter commands like in the bug report. The shell really takes the command literally, and then doesn't find the command because of quotes. So revert this change. At the same time there's a related problem with hooks. If the path to the hook contains blanks, runInShell() would also fail to find the hook. In this case, the command doesn't come from user input but is just a Java File object with an absolute path containing blanks. (Can occur if core.hooksPath points to such a path with blanks, or if the repository has such a path.) The path to the hook as obtained from the file system must be quoted. Add a test for a hook path with a blank. This reverts commit 2323d7a1ef909f9deb3f21329cf30bd1173ee9cf. Bug: 561666 Change-Id: I4d7df13e6c9b245fe1706e191e4316685a8a9d59 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | * Handle non-normalized index also for executable filesThomas Wolf2020-03-252-9/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 60cf85a4 corrected the handling of check-in for files where the index version is non-normalized, i.e., contains CR-LF line endings. However, it did so only for regular files, not executable files. Bug: 561438 Change-Id: I372cc990c5efeb00315460f36459c0652d5d1e77 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | Prepare 5.7.1-SNAPSHOT buildsMatthias Sohn2020-03-112-55/+55
| | | | | | | | | | | | | | | Change-Id: I29cd1b9872603810f9c4d42424ac326fedf5569f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v5.7.0.202003110725-rv5.7.0.202003110725-rMatthias Sohn2020-03-112-55/+55
| | | | | | | | | | | | | | | Change-Id: Ia4a9122eeb4eea0f379f6611984cfe1143a32f8d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 5.7.1-SNAPSHOT buildsMatthias Sohn2020-03-092-55/+55
| | | | | | | | | | | | | | | Change-Id: I23748c20b69a1cfb47c5cd0d7858182d376b3ce1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v5.7.0.202003090808-rv5.7.0.202003090808-rMatthias Sohn2020-03-092-2/+2
| | | | | | | | | | | | | | | Change-Id: Ia23bffa3952687f6107d496a8932d54b11c12412 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Scan through all merged reftables for max/min update indicesMinh Thai2020-03-201-0/+117
| | | | | | | | | | | | | | | | | | | | | Since reftables might have update index ranges that are overlapped. Change-Id: I8f8215b99a0a978d4dd0155dbaf33e5e06ea8202 Signed-off-by: Minh Thai <mthai@google.com>
* | | ResolveMerger: Ignore merge conflicts if asked soIvan Frade2020-03-191-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recursive merge strategy builds a virtual ancestor merging recursively the common bases (when more than one) between the want-to-merge commits. While building this virtual ancestor, content conflicts are ignored, but current code doesn't do so when a file is removed. This was spotted in [1], for example. Merging two commits to build the virtual ancestor bumped into a conflict (modified in one side, deleted in the other) that stopped the process. Follow the "spec" and in case of conflict leave the unmerged content in the index and working trees. [1] https://android-review.googlesource.com/c/kernel/common/+/1228962 Change-Id: Ife9c32ae3ac3a87d3660fa1242e07854b65169d5 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | Merge "tag option for clone command"Christian Halstrick2020-03-151-0/+46
|\ \ \
| * | | tag option for clone commandAlexander Nittka2020-03-151-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow explicitly setting the tag option for the remote configuration when cloning a repository. Bug: 561021 Change-Id: Iac43268a2bb231ae7599c3255bf555883d34fa32 Signed-off-by: Alexander Nittka <alex@nittka.de>
* | | | RevWalk: fix bad topo flags error messageAlex Spradlin2020-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error message for an Exception thrown by StartGenerator when given both the TOPO flag and the TOPO_KEEP_BRANCH_TOGETHER flag mentions a non-existent flag, TOPO_NON_INTERMIX. The error message was introduced in commit e498d43. Replace TOPO_NON_INTERMIX with TOPO_KEEP_BRANCH_TOGETHER in the error message of an Exception thrown by the StartGenerator when the TOPO flag is provided together with the TOPO_KEEP_BRANCH_TOGETHER flag. Signed-off-by: Alex Spradlin <alexaspradlin@google.com> Change-Id: Id24640dc08e96a196508fe38ce144aa7e035082f
* | | | RevWalk: new topo sort to not mix lines of historyAlex Spradlin2020-03-112-0/+222
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The topological sort algorithm in TopoSortGenerator for RevWalk may mix multiple lines of history, producing results that differ from C git's git-log whose man page states: "Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed." Lines of history are mixed because TopoSortGenerator merely delays producing a commit until all of its children have been produced; it does not immediately produce a commit after its last child has been produced. Therefore, add a new RevSort option called TOPO_KEEP_BRANCH_TOGETHER with a new topo sort algorithm in TopoNonIntermixGenerator. In the Generator, when the last child of a commit has been produced, unpop that commit so that it will be returned upon the subsequent call to next(). To avoid producing duplicates, mark commits that have not yet been produced as TOPO_QUEUED so that when a commit is popped, it is produced if and only if TOPO_QUEUED is set. To support nesting with other generators that may produce the same commit multiple times like DepthGenerator (for example, StartGenerator does this), do not increment parent inDegree for the same child commit more than once. Commit b5e764abd21bd4593287361a625ecc49bc0efd77 modified the existing TopoSortGenerator to avoid mixing lines of history, but it was reverted in e40c38ab08837473375c571c2f07ab680fc1985d because the new behavior caused problems for EGit users. This motivated adding a new Generator for the new behavior. Signed-off-by: Alex Spradlin <alexaspradlin@google.com> Change-Id: Icbb24eac98c00e45c175b01e1c8122554f617933
* / / Prepare 5.8.0-SNAPSHOT buildsMatthias Sohn2020-03-092-55/+55
|/ / | | | | | | | | Change-Id: I056b45806a82eae80177932e42e3dc806015351a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-5.6'Matthias Sohn2020-03-051-8/+34
|\| | | | | | | | | | | | | | | | | | | * stable-5.6: Silence API errors introduced by 093fbbd1 Bump Bazel version to 2.2.0 Expose FileStoreAttributes.setBackground() Update reftable storage repo layout Change-Id: I237eaaed7991e8bbd56a7624f47bbba985330026 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Update reftable storage repo layoutHan-Wen Nienhuys2020-03-041-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change Ic0b974fa (c217d33, "Documentation/technical/reftable: improve repo layout") defines a new repository layout, which was agreed with the git-core mailing list. It addresses the following problems: * old git clients will not recognize reftable-based repositories, and look at encompassing directories. * Poorly written tools might write directly into .git/refs/heads/BRANCH. Since we consider JGit reftable as experimental (git-core doesn't support it yet), we have no backward compatibility. If you created a repository with reftable between mid-Nov 2019 and now, you can do the following to convert: mv .git/refs .git/reftable/tables.list git config core.repositoryformatversion 1 git config extensions.refStorage reftable Change-Id: I80df35b9d22a8ab893dcbe9fbd051d924788d6a5 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add validation to hex decoderMichael Dardis2020-03-041-0/+25
| | | | | | | | | | | | | | | | | | | | Does not fix any issue but prevents user from shooting themselves in the foot with improper configuration. Suggested by Demetr Starshov at https://git.eclipse.org/r/#/c/157681/ Change-Id: I006d65022f0a7d4066970825d00080c59404fdc3 Signed-off-by: Michael Dardis <git@md-5.net> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "ObjectWalk: Add null check before skip tree."Jonathan Nieder2020-03-021-0/+8
|\ \
| * | ObjectWalk: Add null check before skip tree.Yunjie Li2020-02-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | currVisit could be null if a blob is marked as start point in ObjectWalk. Add null check before skipping current tree. Change-Id: Ic5d876fe2800f3373d136979be6c27d1bbd38dc1 Signed-off-by: Yunjie Li <yunjieli@google.com>
* | | Merge "Revert "RevWalk: stop mixing lines of history in topo sort""Jonathan Nieder2020-02-263-159/+43
|\ \ \ | |/ / |/| |
| * | Revert "RevWalk: stop mixing lines of history in topo sort"Alex Spradlin2020-02-263-159/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b5e764abd21bd4593287361a625ecc49bc0efd77. PlotWalk uses the TopoSortGenerator, which is causing problems for EGit users who rely on the emission of commits being somewhat based on date as in the previous topo-sort algorithm. Bug: 560529 Change-Id: I3dbd3598a7aeb960de3fc39352699b4f11a8c226 Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
* | | Merge branch 'stable-5.6'Matthias Sohn2020-02-224-9/+9
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.6: Revert "Prepend hostname to subsection used to store file timestamp resolution" SimilarityRenameDetector: Fix inconsistent indentation Use indexOf(char) and lastIndexOf(char) rather than String versions Reorder modifiers to follow Java Language Specification GitmoduleEntry: Remove redundant import of class from same package Remove redundant "static" qualifier from enum declarations Change-Id: Ibb66bef7e8373f81e3e653c9843d986243446d68 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Reorder modifiers to follow Java Language SpecificationDavid Pursehouse2020-02-193-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Java Language Specification recommends listing modifiers in the following order: 1. Annotations 2. public 3. protected 4. private 5. abstract 6. static 7. final 8. transient 9. volatile 10. synchronized 11. native 12. strictfp Not following this convention has no technical impact, but will reduce the code's readability because most developers are used to the standard order. This was detected using SonarLint. Change-Id: I9cddecb4f4234dae1021b677e915be23d349a380 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | Remove redundant "static" qualifier from enum declarationsDavid Pursehouse2020-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Nested enum types are implicitly static. Change-Id: Id3d7886087494fb67bc0d080b4a3491fb4baac19 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Remove use of org.bouncycastle.util.encoders.HexMichael Dardis2020-02-222-1/+49
| | | | | | | | | | | | | | | Change-Id: I5c1ed0397ef99eb5d4f120da331b66c2d0f1707a Signed-off-by: Michael Dardis <git@md-5.net> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Remove use of org.bouncycastle.util.io.TeeOutputStreamMichael Dardis2020-02-211-0/+81
| | | | | | | | | | | | | | | | | | Bug: 559106 Change-Id: Ife06f21a00d258780a2030745738194098c631cf Signed-off-by: Michael Dardis <git@md-5.net> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-5.7'Matthias Sohn2020-02-191-1/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.7: Update API problem filter Prepare 5.6.2-SNAPSHOT builds JGit v5.6.1.202002131546-r Simplify ReftableCompactor Change-Id: I1aa650e030fbaa7a1c898eef1836de529e0c30db Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | Merge branch 'stable-5.6' into stable-5.7Matthias Sohn2020-02-191-1/+5
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Matthias Sohn (3) and Han-Wen Nienhuys (1) * stable-5.6: Update API problem filter Prepare 5.6.2-SNAPSHOT builds JGit v5.6.1.202002131546-r Simplify ReftableCompactor Change-Id: I16ed174f9fc662934c3ebaea85a60690efbed1c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | Prepare 5.6.2-SNAPSHOT buildsMatthias Sohn2020-02-142-55/+55
| | | | | | | | | | | | | | | | | | | | Change-Id: Ie04d749bf16eea6db5e5c98be54ba093ca249d05 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | JGit v5.6.1.202002131546-rv5.6.1.202002131546-rMatthias Sohn2020-02-132-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I2807b9a9f7e8b877b72702ebd1f70c4f9f223481 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | Simplify ReftableCompactorHan-Wen Nienhuys2020-02-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ReftableCompactor supported a byteLimit, but this is currently unused. The FileReftableStack has a more sophisticated strategy that amortizes compaction costs. Rename min/maxUpdateIndex to reflogExpire{Min,Max}UpdateIndex to reflect their purpose more accurately. Since reflogs are generally pruned chronologically (oldest entries are expired first), one can only prune entries on full compaction, so they should not be set by default. Rephrase the function Reader#minUpdateIndex and maxUpdateIndex. These vars are documented to affect log entries, but semantically, they are about ref entries. Since ref entries have their timestamps delta-compressed, it is important for the min/maxUpdateIndex values to be coherent between different tables. The logical timestamps for log entries do not have to be coherent in different tables, as the timestamps of a log entry is part of the key. For example, a table written at update index 20 may contain a tombstone log entry at timestamp 1. Therefore, we set ReftableWriter's min/maxUpdateIndex from the merged tables we are compacting, rather than from the compaction settings (which should only control reflog expiry.) The previous behavior could drop log entries erroneously, especially in the presence of tombstone log entries. Unfortunately, testing this properly requires both an API for adding log tombstones, and a more refined API for controlling automatic compaction. Hence, no test. Change-Id: I2f4eb7866f607fddd0629809e8e61f0b9097717f Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* | | | Merge "RevWalk: stop mixing lines of history in topo sort"Jonathan Tan2020-02-183-43/+159
|\ \ \ \ | | |_|/ | |/| |
| * | | RevWalk: stop mixing lines of history in topo sortAlex Spradlin2020-02-183-43/+159
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The topological sort algorithm in TopoSortGenerator for RevWalk may mix multiple lines of history, producing results that differ from C git's git log whose man page states: "Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed." Lines of history are mixed because TopoSortGenerator merely delays a commit until all of its children have been produced; it does not immediately produce a commit after its last child has been produced. Therefore, when the last child of a commit has been produced, unpop the commit so that it will be returned upon the subsequent call to next() in TopoSortGenerator. To avoid producing duplicates, mark commits that have not yet been produced as TOPO_QUEUED so that when a commit is popped, it is produced if and only if TOPO_QUEUED is set. To support nesting with other generators that may produce the same commit multiple times like DepthGenerator (for example, StartGenerator does this), do not increment parent inDegree for the same child commit more than once. Modify tests that assert that TopoSortGenerator mixes lines of commit history. Change-Id: I4ee03c7a8e5265d61230b2a01ae3858745b2432b Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
* / / Removed unused importsAndrey Loskutov2020-02-172-2/+0
|/ / | | | | | | | | | | | | | | This fixes compilation errors in 4.15 M3 Bug: 560210 Change-Id: I7f36edc7fb83c66c8889d7573b4439d5a52334e4 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>