summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-02-21 18:22:04 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2024-02-21 18:23:27 +0100
commit265550e63719c47ac9fc59fce107914acf0f8522 (patch)
tree56931e98a84a0beef4386fe6b05d11db1f69ad40 /org.eclipse.jgit.junit
parent3fc0ec18228d392aecf5d15198e001815726b5d5 (diff)
parent5481bfda90e403d49156b04446b06a8efd304449 (diff)
downloadjgit-265550e63719c47ac9fc59fce107914acf0f8522.tar.gz
jgit-265550e63719c47ac9fc59fce107914acf0f8522.zip
Merge branch 'master' into next
* master: Delete org.eclipse.jgit.ssh.apache.agent/bin/.project Allow to discover bitmap on disk created after the packfile Update jetty to 10.0.20 Update maven plugins Update org.assertj:assertj-core to 3.25.3 Update org.mockito:mockito-core to 5.10.0 Update org.apache.commons:commons-compress to 1.26.0 Update byte-buddy to 1.14.12 Add SystemReader.Delegate to reduce boiler-plate code needed to subclass storage.file: Do not throw NSFE when deleting tmp files FS.detectSymlinkSupport: fix a race RefDirectory: Do not unlock until after deleting loose ref Add missing javadoc description for declared exception SnapshottingRefDirectory: Invalidate snapshot after locking ref for update SnapshottingRefDir: Replace lambas with method refs SnapshottingRefDir: Reduce casts with overrides [errorprone] Fix wrong comparison which always evaluated to false [errorprone] Remove unnecessary comparison Errorprone EscapedEntity: Do not use HTML entities inside @code javadoc ChangedPathFilter: Suppress warning about backing array (errorprone) PackWriterBitmapPreparer: Do not generate bitmaps for excessive branch tips. Don't use localized String during JVM shutdown RawParseUtils.nextLfSkippingSplitLines: fulfil contract as stated [gpg] Refactor the GpgSignatureVerifier RawParseUtils: utility method to get a header value Improve handling of NFS stale handle errors Fix handling of missing pack index file Add tests for handling pack files removal during fetch RebaseCommand: fix stopping on root commit conflicts Improve handling of NFS stale handle errors Fix handling of missing pack index file CherryPick: add ability to customise cherry-picked commit message RawParseUtils: Add missing @since tag for new API method Silence API warning for new constant [ssh] Bump Apache MINA sshd 2.11.0 -> 2.12.0 Introduce a PriorityQueue sorting RevCommits by commit timestamp Remove org.eclipse.jgit.benchmark/.factorypath Update jmh to 1.37 for org.eclipse.jgit.benchmark Add tests for handling pack files removal during fetch PackWriterBitmapPreparer: Set limit on excessive branch count Update jna to 5.14.0 DfsInserter/PackParser: keep min size for index in the inserter FooterLines: handle extraction from messages without headers Silence API warnings Remove invalid/unnecessary Maven settings Update maven plugins Update org.eclipse.dash:license-tool-plugin to 1.1.0 Enable using slf4j 2.x Update Tycho to 4.0.4 Update mockito to 5.8.0 Add 4.31 target platform and update orbit to 4.31 Update ecj to 3.36.0 Renormalize line endings based on .gitattributes Configure .gitattributes to manage line endings Normalize line endings to LF for all text files BasePackFetchConnection: Skip object/ref lookups if local repo is empty LooseObjects: Use File#exists when possible Remove invalid spotbugs configuration Fix PMD plugin configuration DfsReader: give subclasses visiblity over the pack bitmap index PackBitmapIndex/StoredBitmap: Expose size and counts PackWriter/Statistics: Remove the bitmapt hit stats Configure Github issue reporting Make sure ref to prune is in packed refs FooterLine: Protect from ill-formed message API filter for PackStatistics.objectsWithBitmapsFound StartGenerator: Fix parent rewrite with non-default RevFilter Update MANIFEST.MF Document option gc.writeCommitGraph Bump last release version to 6.8.0.202311291450-r Prepare 6.9.0-SNAPSHOT builds BitmapWalkerTest: New test for the walker PackWriter: store the objects with bitmaps in the statistics FooterLine: First line cannot be a footer Reapply "Improve footer parsing to allow multiline footers." Revert "Improve footer parsing to allow multiline footers." Prepare 6.8.1-SNAPSHOT builds JGit v6.8.0.202311291450-r Rename method parameter to fix warning about hidden field Fix warnings about empty control flow statements BitmapIndexImpl: externalize error message Suppress not-externalized string warnings Silence API error for new method BitmapIndex#addBitmapLookupListener Update Orbit to orbit-aggregation/2023-12 Adapt to type parameter added in commons-compress 1.25.0 Improve footer parsing to allow multiline footers. Make the tests buildable by bazel test Prepare 6.8.0-SNAPSHOT builds JGit v6.8.0.202311212206-rc1 BitmapIndex: Add interface to track bitmaps found (or not) BitmapWalker: Remove BitmapWalkListener Update repository URLs in CONTRIBUTING.md Fix typo in FileUtils.isStaleFileHandle() javadoc Fix branch ref exist check gpg.bc: Supress errorprone InsecureCryptoUsage Adjust javadoc to pass errorprone checks Update org.apache.commons:commons-compress to 1.25.0 Fix annotation of deprecated constant CONFIG_KEY_STREAM_FILE_TRESHOLD BitmapWalkListener: Use plain interface with noop instance BitmapWalkListener: Add method and rename for commits Update bouncycastle to 1.77 PatchApplier: wrap output's TemporaryBuffer with a CountingOutputStream BitmapWalker: announce walked objects via listener interface Prepare 6.8.0-SNAPSHOT builds Update jetty to 10.0.18 SSH: bump org.apache.sshd to 2.11.0 JGit v6.8.0.202311151710-m2 Fix typo in constant name CONFIG_KEY_STREAM_FILE_TRESHOLD Simplify StringUtils#commonPrefix Optimize RefDirectory.getRefsByPrefix(String...) CommitGraphWriter: Remove unnecesary progress update call Use try-with-resource to ensure UploadPack is closed Fix hiding field warning Fix warning for empty code blocks Fix boxing warnings errorprone: remove unnecessary parentheses Update mockito to 5.7.0 and bytebuddy to 1.14.9 Enable Maven reproducible builds Upgrade bazlets to the latest revision Revert "Optimise Git protocol v2 `ref-prefix` scanning" Document GIT_TRACE_PERFORMANCE to show timings config-options.md: fix sort order ComboBitset: Add Javadoc CommitGraphWriter: Add progress monitor to bloom filter computation CommitGraphWriter: Use ProgressMonitor from the OutputStream CommitGraphWriter: Unnest generation-number progress Optimise Git protocol v2 `ref-prefix` scanning UploadPackTest: Cover using wanted-refs as advertised set UploadPack: use want-refs as advertised set in fetch v2 BasePackFetchConnection: Avoid full clone with useNegotiationTip Checkout: better directory handling .gitignore: ignore all Maven output directories `target/` benchmarks: use org.eclipse.jgit-parent as parent pom Generate SBOMs using cyclonedx maven plugin DfsPackFile: Do not attempt to read stream if pack doesn't have it PackObjectSizeIndexLoader: Log wrong bytes on exception Silence API warnings for API added in 5.13.3 FileBasedConfig: in-process synchronization for load() and save() FileUtils.rename(): better retry handling FileBasedConfig: ensure correct snapshot if no file DeleteBranchCommand: update config only at the end Config.removeSection() telling whether it changed the config RebaseCommand: return correct status on stash apply conflicts Use net.i2p.crypto.eddsa 0.3.0 from new Orbit build PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing [errorprone] Fix InconsistentCapitalization TestRepository: Add getInstant method Update orbit to orbit-aggregation/2023-12 Prepare 6.8.0-SNAPSHOT builds JGit v6.8.0.202310031045-m1 UploadPack: Delay freeing refs in sendPack() ByteBufferInputStream: add missing @since 6.8 Fix log level for successful execution of ShutdownHook#notify to debug Eclipse features: update copyright year SSH agent: correct plug-in title Fix DefaultCharset bug pattern flagged by error prone Activate additional error prone checks WorkingTreeIterator: directly filter input stream [errorprone] Add missing javadoc summary [errorprone] Fix BadImport [errorprone] Prevent int expression may overflow [errorprone] Suppress ByteBufferBackingArray [errorprone] Suppress JavaLangClash to avoid breaking change [errorprone] Fix EqualsGetClass [errorprone] MockSystemReader: fix CatchAndPrintStackTrace [errorprone] MetaFilter: fix IdentityHashMapUsage [errorprone] InternalFetchConnection: Suppress CatchAndPrintStackTrace [errorprone] Don't swallow exception [errorprone] Fix inconsistent capitalization [errorprone] PageRef#isStringRef: suppress UnusedMethod [errorprone] FileReftableStack: fix EqualsUnsafeCast [errorprone] Suppress MissingSummary for translation bundles [errorprone] CommandLineMergeTool: Remove unused constuctor [errorprone] SimilarityRenameDetector: suppress IntLongMath Add comment why protocol list uses WeakReference [errorprone] Transport: Suppress ModifyCollectionInEnhancedForLoop [errorprone] Rename method parameter to silence InvalidParam [errorprone] MyersDiff#main: fix CatchAndPrintStackTrace [errorprone] TagCommand: Remove unused parameter of private method [errorprone] PathFilter#getPathsBestEffort: fix ArrayAsKeyOfSetOrMap [errorprone] DirCacheEntry: suppress JavaInstantGetSecondsGetNano [errorprone] Directly implement functional interface [errorprone] InterruptTimer#terminate: ensure Thread#join succeeds [errorprone] RawParseUtils@parseHexInt64: suppress IntLongMath [errorprone] Exceptions should not override #toString [errorprone] Fix invalid param in javadoc [errorprone] FS#searchPath: handle surprising behavior of String#split [errorprone] FileStoreAttributes#FUTURE_RUNNER: Fix corePoolSize [errorprone] Express duration using seconds which is clearer [errorprone] Use ArrayList instead of LinkedList [errorprone] AddCommand#filepattern: use a more specific type [errorprone] Suppress UnnecessaryParentheses [errorprone] Remove unnecessary parentheses tools/BUILD: Sort errorprone rules alphabetically Update jetty to 10.0.16 Update bazel to 6.3.2 DfsPackFile: remove unnecessary @SuppressWarnings("boxing") CommitGraphWriter: Remove unnecessary semicolon CommitGraphWriter: fix boxing warnings CommitGraphWriter#createCoreChunks: Remove not-thrown exceptions CommitGraphWriter: Decouple Stats from computing bloom filters CommitGraphWriter: Move bloom filter calculation out of createChunks Documentation: Move writeChangedPaths flag from commitGraph to gc section. [errorprone] Fix wrong comparison which always evaluated to false [errorprone] Remove unnecessary comparison Update org.eclipse.jdt:ecj to 3.35.0 Update org.apache.commons:commons-compress to 1.24.0 [errorprone] Suppress ImmutableEnumChecker for ShutdownHook Update bytebuddy to 1.14.8 Use ShutdownHook to gracefully handle JVM shutdown Add ShutdownHook to cleanup FileLocks on graceful JVM shutdown Unregister ShutdownHook when GC#PidLock is closed OSGi: move plugin localization to subdirectory ssh: Remove redundant null check for home.getAbsoluteFile() RevertCommand: support for inserting a Gerrit change ID [releng] Bump japicmp base version to 6.7.0.202309050840-r DfsPackFile: Record index loads only in one place DfsPackfile: Emit the index load with the index object Prepare 6.8.0-SNAPSHOT builds Prepare 6.7.1-SNAPSHOT builds Switch back to wagon-ssh-external Fix generation of maven site Ensure home directory not null before using in Sshdsessionfactory CommitGraphWriter: Make the list of chunks immutable CommitGraphWriter: Assert written bytes JGit v6.7.0.202309050840-r Remove unused API problem filters [releng] Bump japicmp base version to 6.6.0.202305301015-r Fix list of 3rd party bundles in p2 repo Add missing source bundle org.osgi.service.cm.source to target platform Prepare 6.6.2-SNAPSHOT builds JGit v6.6.1.202309021850-r Checkout: better directory handling CommitGraphWriter: throw exception on unknown chunk Document commit-graph options supported by JGit Fix warning raised for local variable hiding DfsPackFile#index Suppress boxing warnings in DfsPackFile Remove unused API problem filters Suppress boxing warnings in tests Fix warning about empty block Update mockito to 5.5.0 Update byte-buddy to 1.14.7 Prepare 6.7.0-SNAPSHOT builds JGit v6.7.0.202308301100-rc1 Remove the cbi-snapshots Maven repository Update Orbit to orbit-aggregation/release/4.29.0 Add target platform for Eclipse 2023-09 (4.29) Use release p2 repo for Eclipse 2023-06 (4.28) Update tycho to 4.0.2 Update jmh to 1.37 Update bouncycastle to 1.76 Fix some tests in ConfigTest Handle global git config $XDG_CONFIG_HOME/git/config IO: use JDK convenience methods org.eclipse.jgit.junit.ssh/.settings/.api_filters: fix unclosed tags ReadChangedPathFilter: fix Non-externalized string literal warning Introduce core.packedIndexGitUseStrongRefs config key DfsReader: Make PackLoadListener interface visible to subclasses DfsGarbageCollector: provide commit graph stats DfsGarbageCollector: put only GC commits into the commit graph DfsReader: Expose when indices are loaded Update to Tycho 4.0.1 Prepare 6.7.0-SNAPSHOT builds JGit v6.7.0.202308011830-m2 Add missing @since tags Fix errorprone warning about precedence Move footer-line parsing methods from RevCommit to FooterLine Merge: Add diff3 style merge conflict formatter. RevCommitCG: Read changed-path-filters directly from commit graph Update commons-codec to 1.16.0 Add missing @since tags for new API methods Add missing package import needed to use MurmurHash3 Identify a commit that generates a diffEntry on a rename Event. Pack: open reverse index from file if present PackReverseIndexV1: reverse index parsed from version 1 file PackReverseIndex: open file if present otherwise compute PackReverseIndex: verify checksums ComputedPackReverseIndex: Clarify custom bucket sort algorithm CommitGraphWriter: add option for writing/using bloom filters CommitGraphWriter: reuse changed path filters RevWalk: use changed path filters CommitGraphLoader: read changed-path filters CommitGraphWriter: write changed-path filters ssh: PKCS#11 support GC: Remove handling of extra pack for RefTree Remove unnecessary @SuppressWarnings("serial") Remove unused API problem filters Remove redundant specification of type arguments DfsPackParser: Create object indices if config says so PackParserTest: Extract pack-writing helper code to its own class DfsInserter: generate object size index if config says so DfsInserter: populate full size on object insertion DFSGarbargeCollector: Write object size indices DfsReader/PackFile: Implement isNotLargerThan using the obj size idx [releng] Use tycho 4.0.0 instead of 4.0.0-SNAPSHOT Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Update mockito to 5.4.0 and bytebuddy to 1.14.5 Fix S3Repository getSize to handle larger object sizes DfsPackFile: make #getReverseIdx public Add missing bazel dependency to benchmarks Update JMH to 1.36 Update bouncycastle to 1.75 Update org.eclipse.jdt:ecj to 3.34.0 Update eclipse-jarsigner-plugin to 1.4.2 Update maven-surefire-report-plugin to 3.0.0 Update maven-project-info-reports-plugin to 3.4.3 Update maven-compiler-plugin to 3.11.0 Update maven-enforcer-plugin to 3.3.0 Update build-helper-maven-plugin to 3.4.0 Update spring-boot-maven-plugin to 2.7.13 Update maven-source-plugin to 3.3.0 Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r PackReverseIndex: separate out the computed implementation Default for global (user) git ignore file Fix all Javadoc warnings and fail on them Mark COMMIT_GENERATION_* constants final Update Orbit to R20230531010532 for 2023-06 Revert "RefDirectory: Throw exception if CAS of packed ref list fails" PackReverseIndex: use static builder instead of constructor Gc#writePack: write the reverse index file to disk Bazel: Fix remote build execution for Java 17 Bump bazel vesion to 6.2.0 Prepare 6.6.1-SNAPSHOT builds JGit v6.6.0.202305301015-r Bump bazel vesion to 6.2.0 Update to Orbit S20230516204213 Prepare 6.6.0-SNAPSHOT builds Prepare 6.7.0-SNAPSHOT builds JGit v6.6.0.202305241045-m3 GraphObjectIndex: fix search in findGraphPosition Update to Tycho 4.0.0-SNAPSHOT PGP sign p2 artefacts Revert 'Use net.i2p.crypto:eddsa directly from Maven Central' Update dash license-tool-plugin to 1.0.2 Also add suppressed exception if unchecked exception occurs in finally Candidate: use "Objects.equals" instead of "==" Use hamcrest 2.2 directly from Maven Central Use commons-logging directly from Maven Central Update jna to 5.13.0 Use bytebuddy directly from Maven Central Use jna directly from Maven Central Use net.i2p.crypto:eddsa directly from Maven Central Use org.tukaani:xz directly from Maven Central Use args4j directly from Maven Central Use gson directly from Maven Central Remove unused $NON-NLS-1$ Remove unused API filters Switch to Apache MINA sshd 2.10.0 [releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX PackExt: add a #getTmpExtension method UploadPack: Record negotiation stats on fetchV2 call RewriteGeneratorTest: Introduce test cases for the RewriteGenerator PackWriter: write the PackReverseIndex file Prepare 6.6.0-SNAPSHOT builds JGit v6.6.0.202305031100-m2 Update Maven plugins Add TransportHttp#getAdditionalHeaders Add 4.27 (2023-03) and 4.28 (2023-06) target platforms Fix inProcessPackedRefsLock not shared with copies of the instance Update slf4j to 1.7.36 and consume it directly from Maven Central Update assertj-core to 3.24.2 Update plexus-compiler to 2.13.0 Update Apache commons-codec to 1.15 Update org.apache.commons:commons-compress to 1.23.0 Update javaEWAH to 1.2.3 and use it directly from Maven central Update org.eclipse.jdt:ecj to 3.33.0 Add missing @since tag to IntComparator Update to jakarta.servlet:jakarta.servlet-api:4.0.4 Support rebasing independent branches Support cherry-picking a root commit AddCommand: ability to switch off renormalization Update jetty to 10.0.15 and use it from Maven central directly Update bouncycastle to 1.73 [errorprone] Fix MissingOverride error PackReverseIndexWriter: write out version 1 reverse index file IntList: add #sort using quick sort for O(n log n) runtime. [bazel] Move ToolTestCase to src folder (6.2) GcConcurrentTest: @Ignore flaky testInterruptGc Fix CommitTemplateConfigTest Fix after_open config and Snapshotting RefDir tests to work with bazel [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory Demote severity of some error prone bug patterns to warnings [bazel] Fix version number of bcpg-jdk18on Parse pull.rebase=preserve as alias for pull.rebase=merges Use bouncycastle libraries directly from Maven Central UploadPack: Fix NPE when traversing a tag chain Add missing @since tag for BatchRefUpdate#getRefDatabase Add missing since tag for SshBasicTestBase Add missing since tag for SshTestHarness#publicKey2 Silence API errors Prevent infinite loop rescanning the pack list on PackMismatchException Remove blank in maven.config PackedBatchRefUpdate#execute: reduce nesting of try-catch blocks PackedBatchRefUpdate: Handle the case where loose refs fail to pack Remove blank in maven.config Add protocol configuration to Amazon S3 transport [pgm] Implement git tag --contains option ListTagCommand: implement git tag --contains RevWalk: use generation number to optimize getMergedInto() DfsPackFile: Extract block aligment code Ensure parsed RevCommitCG has derived data from commit-graph PatchApplierTest: specify charset to avoid warning GcConcurrentTest: @Ignore flaky testInterruptGc PatchApplier: Check for existence of src/dest files before any operation Revert "RefDirectory: Throw exception if CAS of packed ref list fails" RefDirectory.delete: Prevent failures when packed-refs is outdated RefDirectory.pack: Only rely on packed refs from disk RefDirectory: Make pack() and commitPackRefs() void Implement a snapshotting RefDirectory for use in request scope Fix RefDirectoryTest.testGetRefs_LooseSorting_Bug_348834 PackedBatchRefUpdate: Ensure updates are applied on latest packed refs Downgrade maven-site-plugin to 3.12.1 Use wagon-ssh-external to deploy Maven site Record my e-mail change in .mailmap [releng] Bump japicmp base version PatchApplier: missing @since, and minor formatting BasePackFetchConnection: support negotiationTip feature DirCache: support option index.skipHash PatchApplierTest: Remove test data with Apache license Fix PatchApplier error handling. Ensure FileCommitGraph scans commit-graph file if it already exists GC: Close File.lines stream GC: Close File.lines stream Rerun flaky tests 3 times Prepare 6.5.1-SNAPSHOT builds JGit v6.5.0.202303070854-r Ignore generated org.eclipse.jgit.benchmarks/dependency-reduced-pom.xml [sshd] Fix calculation of timeout in AbstractClientProxyConnector Silence API error raised for removed BranchRebaseMode#PRESERVE [errorprone] Suppress [Finally] warnings Update Orbit to R20230302014618 for 2023-03 Improve test coverage when core.trustPackedRefsStat set to after_open Prepare 6.6.0-SNAPSHOT builds Prepare 6.5.0-SNAPSHOT builds JGit v6.5.0.202302281825-rc1 Prepare 6.5.0-SNAPSHOT builds Change config pull.rebase=preserve to pull.rebase=merges BatchingProgressMonitor: expose time spent per task PackWriter: offer to write an object-size index for the pack Fix formatting in GC#doGc PackExt: Define new extension for the object size index JGit v6.5.0.202302221508-m3 If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Use Java 11 ProcessHandle to get pid of the current process UploadPack: use allow-any-sha1-in-want configuration Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Externalize strings introduced in c9552aba Silence API error introduced by 596c445a PackConfig: add entry for minimum size to index Fix getPackedRefs to not throw NoSuchFileException PackObjectSizeIndex: interface and impl for the object-size index UInt24Array: Array of unsigned ints encoded in 3 bytes. PackIndex: expose the position of an object-id in the index Add pack options to preserve and prune old pack files DfsPackFile/DfsGC: Write commit graphs and expose in pack ObjectReader: Allow getCommitGraph to throw IOException Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec UploadPack: consume delimiter in object-info command PatchApplier fix - init cache with provided tree Prepare 6.5.0-SNAPSHOT builds JGit v6.5.0.202302011120-m2 Avoid error-prone warning Fix unused exception error-prone warning UploadPack: advertise object-info command if enabled Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap Move MemRefDatabase creation in a separate method. PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage DfsReaderIoStats: Add Commit Graph fields into DfsReaderIoStats [pgm] Fetch-CLI: add support for shallow Speedup GC listing objects referenced from reflogs Re-add servlet-api 4.0 to the target platform Upgrade maven plugins Cache trustFolderStat/trustPackedRefsStat value per-instance Refresh 'objects' dir and retry if a loose object is not found Prepare 6.5.0-SNAPSHOT builds JGit v6.5.0.202301111425-m1 Update Orbit to S20230101190934 Update to releases p2 repo for 4.26 simultaneous release RevWalk: integrate commit-graph with commit parsing FileSnapshotTest: Add more MISSING_FILE coverage GC: disable writing commit-graph for shallow repos Introduce core.trustPackedRefsStat config RefDatabase: fix javadoc formatting Pull up additionalRefsNames from RefDirectory to RefDatabase Add TernarySearchTree CommitGraph: teach ObjectReader to get commit-graph PatchApplier: fix handling of last newline in text patch CommitGraph: add commit-graph for FileObjectDatabase Reformat PatchApplier and PatchApplierTest PackWriter#prepareBitmapIndex: add clarifying comments IO#readFully: provide overload that fills the full array Fix API warnings for the new CommitGraph PackReverseIndex#findPosition: fix typo in method name GC: Write commit-graph files when gc CommitGraph: add core.commitGraph config CommitGraph: implement commit-graph read Gc#deleteOrphans: avoid dependence on PackExt alphabetical ordering WalkPushConnection: Sanitize paths given to transports Fix documentation for core.trustFolderStat GraphCommits: Remove unused getter by position CommitGraphWriter: fix UnusedException errorprone error Update jetty to 10.0.13 PackExt: Add a commit graph extension. BatchRefUpdate: Consistent switch branches in ref update RefWriter#writePackedRefs: Remove a redundant "if" check commitgraph package: fix exports/imports, add @since tag for new API CommitGraph: implement commit-graph writer [releng] bump japicmp base version Prepare 6.4.1-SNAPSHOT builds JGit v6.4.0.202211300538-r Fix crashes on rare combination of file names Prepare 6.5.0-SNAPSHOT builds Prepare 6.4.0-SNAPSHOT build JGit v6.4.0.202211231055-rc1 [pgm] Add options --name-only, --name-status to diff, log, show Update Orbit to R20221123021534 for 2022-12 RBE: Update toolchain with bazel-toolchains 5.1.2 release SshTestGitServer: : ensure UploadPack is closed to fix resource leak UploadPackTest: ensure UploadPack is closed to fix resource leak [pgm] Ensure UploadPack is closed to fix resource leak UploadPackServlet#doPost use try-with-resource to ensure up is closed Fix warnings in PatchApplierTest Fix boxing warnings in TransportTest Silence warnings about unclosed BasePackPushConnection Fix warning about non-externalized String Remove unused imports Suppress non-externalized String warnings Remove unused API problem filters Silence API errors Silence API errors Silence API warnings Add 4.26 target platform Use "releases" repository for 4.25 target platform Update Apache Mina SSHD to 2.9.2 Update Orbit to S20221118032057 DfsBlockCache: Report IndexEventConsumer metrics for reverse indexes. DfsStreamKey: Replace ForReverseIndex to separate metrics. Prepare 6.4.0-SNAPSHOT builds RawText.isBinary(): handle complete buffer correctly JGit v6.4.0.202211160543-m3 PackExt: Add a reverse index extension. [benchmarks] Remove profiler configuration Add SHA1 benchmark [benchmarks] Set version of maven-compiler-plugin to 3.8.1 Fix running JMH benchmarks Add option to allow using JDK's SHA1 implementation Fix API breakage caused by extracting WorkTreeUpdater Update Orbit to S20221109014815 Use replace instead of replaceAll in toCleanString Extract Exception -> HTTP status code mapping for reuse Don't handle internal git errors as an HTTP error Fix the path for JSchText.properties Fix crashes on rare combination of file names Fix Maven SHA1 for Bazel build UploadPack: Receive and parse client session-id TransferConfig: Move reading advertisesid setting into TransferConfig FirstWant: Parse client session-id if received. ReceivePack: Receive and parse client session-id. Ignore IllegalStateException if JVM is already shutting down Prepare 6.4.0-SNAPSHOT builds Allow to perform PackedBatchRefUpdate without locking loose refs JGit v6.4.0.202210260700-m2 PushCommand: allow users to disable use of bitmaps for push I/O redirection for the pre-push hook PackParser: populate full size of the PackedObjectInfos PackedObjectInfo: add the full size to the description ObjectReader: New #isNotLargerThan method Fail build if there are license issues with dependencies Update org.apache.httpcomponents:httpcore to 4.4.15 Update Orbit to S20220927175816 Update JMH to 1.35 Update org.eclipse.jdt:ecj to 3.31.0 Update plexus compiler to 2.12.1 Update org.apache.maven.wagon:wagon-ssh to 3.5.2 pgm/BUILD: Add dependencty to java EWAH [sshd] Guard against numerical overflow Remove unused imports Remove unused API filters ObjectDirectory: avoid using File.getCanonicalPath() AutoCRLFOutputStream: use BufferedOutputStream CloneCommand: set HEAD also when not checking out Pass on shallowSince only if not null Fix wrong @since tag Split out ApplyCommand logic to PatchApplier class Prepare 6.4.0-SNAPSHOT builds Fix typo in FetchV2Request javadoc Prepare 6.3.1-SNAPSHOT builds DfsBundleWriter: Add test case about GC_REST pack. JGit v6.3.0.202209071007-r JGit v6.3.0.2022009070944-r [merge] Fix merge conflicts with symlinks Update DEPENDENCIES for 6.3.0 Update tycho to 2.7.5 Move WorkTreeUpdater to merge package WorkTreeUpdater: use DirCacheCheckout#StreamSupplier DirCacheCheckout#getContent: also take InputStream supplier Revert "Adds FilteredRevCommit that can overwrites its parents in the DAG." Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator." WorkTreeUpdater: remove safeWrite option Update Orbit to R20220830213456 for 2022-09 BaseSuperprojectWriter: report invalid paths as manifest errors ApplyCommand: fix ApplyResult#updatedFiles WorkTreeUpdater: rename metadata maps WorkTreeUpdater#Result: hide data members Add javadoc on RevCommit Option to pass start RevCommit to be blamed on to the BlameGenerator. WorkTreeUpdater: re-format and clean-up Prepare 6.3.0-SNAPSHOT builds Adds FilteredRevCommit that can overwrites its parents in the DAG. JGit v6.3.0.202208161710-m3 DirCacheCheckout: load WorkingTreeOptions only once WorkTreeUpdater: Fix unclosed streams Fix adding symlinks to the index when core.symlinks=false Remove unused API problem filters Add missing @since tag for RevCommit#parents introduced in 61b4d105e4 Fix API errors caused by 23a71696cd Provide default shallowCommits getter and setter in ObjectDatabase Reapply "Create util class for work tree updating in both filesystem and index." ResolveMerger: add coverage for inCore file => directory transition Provide encoding to String#getBytes() Revert "Create util class for work tree updating in both filesystem and index." Provide a default implementation for set/get shallowCommits on DfsObjDatabase Revert "Adds FilteredRevCommit that can overwrites its parents in the DAG." Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator." CleanCommand: fix prefix matching Option to pass start RevCommit to be blamed on to the BlameGenerator. Adds FilteredRevCommit that can overwrites its parents in the DAG. Add the ability to override parents on RevCommit. Refactor NameConflictTreeWalk.fastMin method Fix BUILD rules for FilteredRenameDetectorTest Rename fastMinHasMatch to allTreesNamesMatchFastMinRef Document TreeWalk#min() Squash error-prone messages Use constants for git packet protocol line identifiers ObjectDirectory: improve reading of shallow file Fetch: add support for shallow [tests] Stabilize the HTTP server's request log NameConflictTreeWalk: respect git order on multi-tree iteration Update Orbit to S20220726152247 and bouncycastle to 1.71 Create util class for work tree updating in both filesystem and index. Fix the handling of .git/info/exclude and core.excludesFile Remove version constraints from org.tukaani.xz package Change-Id: I31997b67bf432ae3bf6b1cde076fa9307b1e00f4
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r--org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.junit/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.jgit.junit/OSGI-INF/l10n/plugin.properties (renamed from org.eclipse.jgit.junit/plugin.properties)0
-rw-r--r--org.eclipse.jgit.junit/build.properties4
-rw-r--r--org.eclipse.jgit.junit/pom.xml2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Assert.java8
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java21
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java70
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java16
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Repeat.java2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java1
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java53
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/StrictWorkMonitor.java10
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java90
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/MonotonicFakeClock.java1
15 files changed, 216 insertions, 69 deletions
diff --git a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
index bdfba71f54..bb15648cbf 100644
--- a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
index c72d302c27..a58b78724e 100644
--- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name
Automatic-Module-Name: org.eclipse.jgit.junit
Bundle-SymbolicName: org.eclipse.jgit.junit
Bundle-Version: 7.0.0.qualifier
-Bundle-Localization: plugin
+Bundle-Localization: OSGI-INF/l10n/plugin
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
@@ -15,6 +15,7 @@ Import-Package: org.eclipse.jgit.annotations;version="[7.0.0,7.1.0)",
org.eclipse.jgit.errors;version="[7.0.0,7.1.0)",
org.eclipse.jgit.internal.storage.file;version="[7.0.0,7.1.0)",
org.eclipse.jgit.internal.storage.pack;version="[7.0.0,7.1.0)",
+ org.eclipse.jgit.internal.util;version="[7.0.0,7.1.0)",
org.eclipse.jgit.lib;version="[7.0.0,7.1.0)",
org.eclipse.jgit.merge;version="[7.0.0,7.1.0)",
org.eclipse.jgit.revwalk;version="[7.0.0,7.1.0)",
@@ -30,7 +31,7 @@ Import-Package: org.eclipse.jgit.annotations;version="[7.0.0,7.1.0)",
org.junit.runner;version="[4.13,5.0.0)",
org.junit.runners;version="[4.13,5.0.0)",
org.junit.runners.model;version="[4.13,5.0.0)",
- org.slf4j;version="[1.7.0,2.0.0)"
+ org.slf4j;version="[1.7.0,3.0.0)"
Export-Package: org.eclipse.jgit.junit;version="7.0.0";
uses:="org.eclipse.jgit.dircache,
org.eclipse.jgit.lib,
diff --git a/org.eclipse.jgit.junit/plugin.properties b/org.eclipse.jgit.junit/OSGI-INF/l10n/plugin.properties
index f40f8e1d9f..f40f8e1d9f 100644
--- a/org.eclipse.jgit.junit/plugin.properties
+++ b/org.eclipse.jgit.junit/OSGI-INF/l10n/plugin.properties
diff --git a/org.eclipse.jgit.junit/build.properties b/org.eclipse.jgit.junit/build.properties
index aa1a008269..931e1631af 100644
--- a/org.eclipse.jgit.junit/build.properties
+++ b/org.eclipse.jgit.junit/build.properties
@@ -1,5 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .,\
- plugin.properties
+ OSGI-INF/,\
+ .
diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml
index 1329d3c032..c33cb29b66 100644
--- a/org.eclipse.jgit.junit/pom.xml
+++ b/org.eclipse.jgit.junit/pom.xml
@@ -72,7 +72,7 @@
<target>
<copy file="META-INF/SOURCE-MANIFEST.MF" tofile="${source-bundle-manifest}" overwrite="true"/>
<replace file="${source-bundle-manifest}">
- <replacefilter token=".qualifier" value=".${maven.build.timestamp}"/>
+ <replacefilter token=".qualifier" value=".${commit.time.version}"/>
</replace>
</target>
</configuration>
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Assert.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Assert.java
index 96713788f8..6e0a8c79ab 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Assert.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Assert.java
@@ -9,8 +9,6 @@
*/
package org.eclipse.jgit.junit;
-import static java.lang.Boolean.valueOf;
-
/**
* Assertion class
*/
@@ -25,7 +23,8 @@ public class Assert {
* actual value
*/
public static void assertEquals(boolean expect, boolean actual) {
- org.junit.Assert.assertEquals(valueOf(expect), valueOf(actual));
+ org.junit.Assert.assertEquals(Boolean.valueOf(expect),
+ Boolean.valueOf(actual));
}
/**
@@ -41,6 +40,7 @@ public class Assert {
public static void assertEquals(String message, boolean expect,
boolean actual) {
org.junit.Assert
- .assertEquals(message, valueOf(expect), valueOf(actual));
+ .assertEquals(message, Boolean.valueOf(expect),
+ Boolean.valueOf(actual));
}
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java
index 61d3b860e9..177d8737cb 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java
@@ -107,6 +107,7 @@ public abstract class JGitTestUtil {
* Get test resource file.
*
* @param fileName
+ * file name
* @return the test resource file
*/
public static File getTestResourceFile(String fileName) {
@@ -141,8 +142,11 @@ public abstract class JGitTestUtil {
* Copy test resource.
*
* @param name
+ * resource name
* @param dest
+ * destination file
* @throws IOException
+ * if an IO error occurred
*/
public static void copyTestResource(String name, File dest)
throws IOException {
@@ -165,10 +169,14 @@ public abstract class JGitTestUtil {
* Write a trash file.
*
* @param db
+ * the repository
* @param name
+ * file name
* @param data
+ * file content
* @return the trash file
* @throws IOException
+ * if an IO error occurred
*/
public static File writeTrashFile(final Repository db,
final String name, final String data) throws IOException {
@@ -181,11 +189,16 @@ public abstract class JGitTestUtil {
* Write a trash file.
*
* @param db
+ * the repository
* @param subdir
+ * under working tree
* @param name
+ * file name
* @param data
+ * file content
* @return the trash file
* @throws IOException
+ * if an IO error occurred
*/
public static File writeTrashFile(final Repository db,
final String subdir,
@@ -237,9 +250,12 @@ public abstract class JGitTestUtil {
* Read a file's content
*
* @param db
+ * the repository
* @param name
+ * file name
* @return the content of the file
* @throws IOException
+ * if an IO error occurred
*/
public static String read(Repository db, String name)
throws IOException {
@@ -251,6 +267,7 @@ public abstract class JGitTestUtil {
* Check if file exists
*
* @param db
+ * the repository
* @param name
* name of the file
* @return {@code true} if the file exists
@@ -264,8 +281,11 @@ public abstract class JGitTestUtil {
* Delete a trash file.
*
* @param db
+ * the repository
* @param name
+ * file name
* @throws IOException
+ * if an IO error occurred
*/
public static void deleteTrashFile(final Repository db,
final String name) throws IOException {
@@ -284,6 +304,7 @@ public abstract class JGitTestUtil {
* the target of the symbolic link
* @return the path to the symbolic link
* @throws Exception
+ * if an error occurred
* @since 4.2
*/
public static Path writeLink(Repository db, String link,
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index a3c5b1202d..407290a399 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -20,7 +20,6 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.time.Instant;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -28,10 +27,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.internal.storage.file.FileRepository;
+import org.eclipse.jgit.internal.util.ShutdownHook;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -85,8 +86,12 @@ public abstract class LocalDiskRepositoryTestCase {
private final Set<Repository> toClose = new HashSet<>();
private File tmp;
+ private File homeDir;
+
/**
* The current test name.
+ *
+ * @since 6.0.1
*/
@Rule
public TestName currentTest = new TestName();
@@ -105,17 +110,26 @@ public abstract class LocalDiskRepositoryTestCase {
* Setup test
*
* @throws Exception
+ * if an error occurred
*/
@Before
public void setUp() throws Exception {
tmp = File.createTempFile("jgit_" + getTestName() + '_', "_tmp");
- CleanupThread.deleteOnShutdown(tmp);
+ Cleanup.deleteOnShutdown(tmp);
if (!tmp.delete() || !tmp.mkdir()) {
throw new IOException("Cannot create " + tmp);
}
mockSystemReader = new MockSystemReader();
SystemReader.setInstance(mockSystemReader);
+ // Mock the home directory. We don't want to pick up the real user's git
+ // config, or global git ignore.
+ // XDG_CONFIG_HOME isn't set in the MockSystemReader.
+ mockSystemReader.setProperty("user.home", tmp.getAbsolutePath());
+ mockSystemReader.setProperty("HOME", tmp.getAbsolutePath());
+ homeDir = FS.DETECTED.userHome();
+ FS.DETECTED.setUserHome(tmp.getAbsoluteFile());
+
// Measure timer resolution before the test to avoid time critical tests
// are affected by time needed for measurement.
// The MockSystemReader must be configured first since we need to use
@@ -187,25 +201,30 @@ public abstract class LocalDiskRepositoryTestCase {
* Tear down the test
*
* @throws Exception
+ * if an error occurred
*/
@After
public void tearDown() throws Exception {
RepositoryCache.clear();
- for (Repository r : toClose)
+ for (Repository r : toClose) {
r.close();
+ }
toClose.clear();
// Since memory mapping is controlled by the GC we need to
// tell it this is a good time to clean up and unlock
// memory mapped files.
//
- if (useMMAP)
+ if (useMMAP) {
System.gc();
- if (tmp != null)
+ }
+ FS.DETECTED.setUserHome(homeDir);
+ if (tmp != null) {
recursiveDelete(tmp, false, true);
- if (tmp != null && !tmp.exists())
- CleanupThread.removed(tmp);
-
+ }
+ if (tmp != null && !tmp.exists()) {
+ Cleanup.removed(tmp);
+ }
SystemReader.setInstance(null);
}
@@ -312,11 +331,11 @@ public abstract class LocalDiskRepositoryTestCase {
* {@link #CONTENT} controlling which info is present in the
* resulting string.
* @return a string encoding the index state
- * @throws IllegalStateException
* @throws IOException
+ * if an IO error occurred
*/
public static String indexState(Repository repo, int includedOptions)
- throws IllegalStateException, IOException {
+ throws IOException {
DirCache dc = repo.readDirCache();
StringBuilder sb = new StringBuilder();
TreeSet<Instant> timeStamps = new TreeSet<>();
@@ -450,6 +469,7 @@ public abstract class LocalDiskRepositoryTestCase {
* a subdirectory
* @return a unique directory for a test
* @throws IOException
+ * if an IO error occurred
*/
protected File createTempDirectory(String name) throws IOException {
File directory = new File(createTempFile(), name);
@@ -465,6 +485,7 @@ public abstract class LocalDiskRepositoryTestCase {
* working directory
* @return a unique directory for a test repository
* @throws IOException
+ * if an IO error occurred
*/
protected File createUniqueTestGitDir(boolean bare) throws IOException {
String gitdirName = createTempFile().getPath();
@@ -485,6 +506,7 @@ public abstract class LocalDiskRepositoryTestCase {
*
* @return a unique path that does not exist.
* @throws IOException
+ * if an IO error occurred
*/
protected File createTempFile() throws IOException {
File p = File.createTempFile("tmp_", "", tmp);
@@ -584,6 +606,7 @@ public abstract class LocalDiskRepositoryTestCase {
* the file
* @return the content of the file
* @throws IOException
+ * if an IO error occurred
*/
protected String read(File f) throws IOException {
return JGitTestUtil.read(f);
@@ -601,29 +624,28 @@ public abstract class LocalDiskRepositoryTestCase {
return new HashMap<>(System.getenv());
}
- private static final class CleanupThread extends Thread {
- private static final CleanupThread me;
+ private static final class Cleanup {
+ private static final Cleanup INSTANCE = new Cleanup();
+
static {
- me = new CleanupThread();
- Runtime.getRuntime().addShutdownHook(me);
+ ShutdownHook.INSTANCE.register(() -> INSTANCE.onShutdown());
+ }
+
+ private final Set<File> toDelete = ConcurrentHashMap.newKeySet();
+
+ private Cleanup() {
+ // empty
}
static void deleteOnShutdown(File tmp) {
- synchronized (me) {
- me.toDelete.add(tmp);
- }
+ INSTANCE.toDelete.add(tmp);
}
static void removed(File tmp) {
- synchronized (me) {
- me.toDelete.remove(tmp);
- }
+ INSTANCE.toDelete.remove(tmp);
}
- private final List<File> toDelete = new ArrayList<>();
-
- @Override
- public void run() {
+ private void onShutdown() {
// On windows accidentally open files or memory
// mapped regions may prevent files from being deleted.
// Suggesting a GC increases the likelihood that our
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
index 6bfe70659b..419fdb1966 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
@@ -144,32 +144,30 @@ public class MockSystemReader extends SystemReader {
* Set a property
*
* @param key
+ * the key
* @param value
+ * the value
*/
public void setProperty(String key, String value) {
values.put(key, value);
}
- /** {@inheritDoc} */
@Override
public String getenv(String variable) {
return values.get(variable);
}
- /** {@inheritDoc} */
@Override
public String getProperty(String key) {
return values.get(key);
}
- /** {@inheritDoc} */
@Override
public FileBasedConfig openUserConfig(Config parent, FS fs) {
assert parent == null || parent == systemGitConfig;
return userGitConfig;
}
- /** {@inheritDoc} */
@Override
public FileBasedConfig openSystemConfig(Config parent, FS fs) {
assert parent == null;
@@ -193,19 +191,16 @@ public class MockSystemReader extends SystemReader {
return systemGitConfig;
}
- /** {@inheritDoc} */
@Override
public String getHostname() {
return "fake.host.example.com";
}
- /** {@inheritDoc} */
@Override
public long getCurrentTime() {
return now;
}
- /** {@inheritDoc} */
@Override
public MonotonicClock getClock() {
return () -> {
@@ -236,31 +231,26 @@ public class MockSystemReader extends SystemReader {
now += secDelta * 1000L;
}
- /** {@inheritDoc} */
@Override
public int getTimezone(long when) {
return getTimeZone().getOffset(when) / (60 * 1000);
}
- /** {@inheritDoc} */
@Override
public TimeZone getTimeZone() {
return TimeZone.getTimeZone("GMT-03:30");
}
- /** {@inheritDoc} */
@Override
public Locale getLocale() {
return Locale.US;
}
- /** {@inheritDoc} */
@Override
public SimpleDateFormat getSimpleDateFormat(String pattern) {
return new SimpleDateFormat(pattern, getLocale());
}
- /** {@inheritDoc} */
@Override
public DateFormat getDateTimeInstance(int dateStyle, int timeStyle) {
return DateFormat
@@ -312,7 +302,7 @@ public class MockSystemReader extends SystemReader {
field.setAccessible(true);
field.set(null, null);
} catch (Exception e) {
- e.printStackTrace();
+ throw new RuntimeException(e);
}
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Repeat.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Repeat.java
index 343aa92f8a..4bf2eb59da 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Repeat.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/Repeat.java
@@ -21,6 +21,8 @@ import java.lang.annotation.Target;
public @interface Repeat {
/**
* Number of repetitions
+ *
+ * @return number of repetitions
*/
public abstract int n();
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java
index adcc10cad8..30fffe9d94 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java
@@ -125,7 +125,6 @@ public class RepeatRule implements TestRule {
}
}
- /** {@inheritDoc} */
@Override
public Statement apply(Statement statement, Description description) {
Statement result = statement;
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
index 04988f6289..3a283ce10d 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
@@ -62,8 +62,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Copy a file
*
* @param src
+ * file to copy
* @param dst
+ * destination of the copy
* @throws IOException
+ * if an IO error occurred
*/
protected static void copyFile(File src, File dst)
throws IOException {
@@ -81,9 +84,12 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Write a trash file
*
* @param name
+ * file name
* @param data
+ * file content
* @return the trash file
* @throws IOException
+ * if an IO error occurred
*/
protected File writeTrashFile(String name, String data)
throws IOException {
@@ -99,6 +105,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* the target of the symbolic link
* @return the path to the symbolic link
* @throws Exception
+ * if an error occurred
* @since 4.2
*/
protected Path writeLink(String link, String target)
@@ -110,10 +117,14 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Write a trash file
*
* @param subdir
+ * in working tree
* @param name
+ * file name
* @param data
+ * file content
* @return the trash file
* @throws IOException
+ * if an IO error occurred
*/
protected File writeTrashFile(final String subdir, final String name,
final String data)
@@ -125,8 +136,10 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Read content of a file
*
* @param name
+ * file name
* @return the file's content
* @throws IOException
+ * if an IO error occurred
*/
protected String read(String name) throws IOException {
return JGitTestUtil.read(db, name);
@@ -149,6 +162,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* @param name
* file name
* @throws IOException
+ * if an IO error occurred
*/
protected void deleteTrashFile(String name) throws IOException {
JGitTestUtil.deleteTrashFile(db, name);
@@ -158,9 +172,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Check content of a file.
*
* @param f
+ * file
* @param checkData
* expected content
* @throws IOException
+ * if an IO error occurred
*/
protected static void checkFile(File f, String checkData)
throws IOException {
@@ -181,7 +197,6 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
/** Working directory of {@link #db}. */
protected File trash;
- /** {@inheritDoc} */
@Override
@Before
public void setUp() throws Exception {
@@ -229,11 +244,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* {@link #CONTENT} controlling which info is present in the
* resulting string.
* @return a string encoding the index state
- * @throws IllegalStateException
* @throws IOException
+ * if an IO error occurred
*/
public String indexState(int includedOptions)
- throws IllegalStateException, IOException {
+ throws IOException {
return indexState(db, includedOptions);
}
@@ -251,7 +266,9 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* a {@link org.eclipse.jgit.treewalk.FileTreeIterator} which
* determines which files should go into the new index
* @throws FileNotFoundException
+ * file was not found
* @throws IOException
+ * if an IO error occurred
*/
protected void resetIndex(FileTreeIterator treeItr)
throws FileNotFoundException, IOException {
@@ -339,7 +356,9 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* @return return the last measured value of the filesystem timer which is
* greater than then the lastmodification time of lastfile.
* @throws InterruptedException
+ * if thread was interrupted
* @throws IOException
+ * if an IO error occurred
* @since 5.1.9
*/
public static Instant fsTick(File lastFile)
@@ -378,8 +397,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Create a branch
*
* @param objectId
+ * new value to create the branch on
* @param branchName
+ * branch name
* @throws IOException
+ * if an IO error occurred
*/
protected void createBranch(ObjectId objectId, String branchName)
throws IOException {
@@ -393,6 +415,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
*
* @return list of refs
* @throws IOException
+ * if an IO error occurred
*/
public List<Ref> getRefs() throws IOException {
return db.getRefDatabase().getRefs();
@@ -402,11 +425,12 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Checkout a branch
*
* @param branchName
- * @throws IllegalStateException
+ * branch name
* @throws IOException
+ * if an IO error occurred
*/
protected void checkoutBranch(String branchName)
- throws IllegalStateException, IOException {
+ throws IOException {
try (RevWalk walk = new RevWalk(db)) {
RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
RevCommit branch = walk.parseCommit(db.resolve(branchName));
@@ -436,7 +460,9 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* the contents which should be written into the files
* @return the File object associated to the last written file.
* @throws IOException
+ * if an IO error occurred
* @throws InterruptedException
+ * if thread was interrupted
*/
protected File writeTrashFiles(boolean ensureDistinctTimestamps,
String... contents)
@@ -459,8 +485,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* one.
*
* @param filename
+ * file name
* @param contents
+ * file content
* @param branch
+ * branch name
* @return the created commit
*/
protected RevCommit commitFile(String filename, String contents, String branch) {
@@ -494,7 +523,9 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param mode
+ * file mode
* @return the DirCacheEntry
*/
protected DirCacheEntry createEntry(String path, FileMode mode) {
@@ -505,8 +536,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param mode
+ * file mode
* @param content
+ * file content
* @return the DirCacheEntry
*/
protected DirCacheEntry createEntry(final String path, final FileMode mode,
@@ -518,9 +552,13 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param mode
+ * file mode
* @param stage
+ * stage index of the new entry
* @param content
+ * file content
* @return the DirCacheEntry
*/
protected DirCacheEntry createEntry(final String path, final FileMode mode,
@@ -538,7 +576,9 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param objectId
+ * of the entry
* @return the DirCacheEntry
*/
protected DirCacheEntry createGitLink(String path, AnyObjectId objectId) {
@@ -553,8 +593,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Assert files are equal
*
* @param expected
+ * expected file
* @param actual
+ * actual file
* @throws IOException
+ * if an IO error occurred
*/
public static void assertEqualsFile(File expected, File actual)
throws IOException {
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/StrictWorkMonitor.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/StrictWorkMonitor.java
index 96d7aac54c..0168ecea30 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/StrictWorkMonitor.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/StrictWorkMonitor.java
@@ -20,34 +20,34 @@ import org.eclipse.jgit.lib.ProgressMonitor;
public final class StrictWorkMonitor implements ProgressMonitor {
private int lastWork, totalWork;
- /** {@inheritDoc} */
@Override
public void start(int totalTasks) {
// empty
}
- /** {@inheritDoc} */
@Override
public void beginTask(String title, int total) {
this.totalWork = total;
lastWork = 0;
}
- /** {@inheritDoc} */
@Override
public void update(int completed) {
lastWork += completed;
}
- /** {@inheritDoc} */
@Override
public void endTask() {
assertEquals("Units of work recorded", totalWork, lastWork);
}
- /** {@inheritDoc} */
@Override
public boolean isCancelled() {
return false;
}
+
+ @Override
+ public void showDuration(boolean enabled) {
+ // not implemented
+ }
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index 54e4a09ee5..a2e0a571eb 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -20,6 +20,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.MessageDigest;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -115,6 +116,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* @param db
* the test repository to write into.
* @throws IOException
+ * if an IO error occurred
*/
public TestRepository(R db) throws IOException {
this(db, new RevWalk(db), new MockSystemReader());
@@ -128,6 +130,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* @param rw
* the RevObject pool to use for object lookup.
* @throws IOException
+ * if an IO error occurred
*/
public TestRepository(R db, RevWalk rw) throws IOException {
this(db, rw, new MockSystemReader());
@@ -144,6 +147,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the MockSystemReader to use for clock and other system
* operations.
* @throws IOException
+ * if an IO error occurred
* @since 4.2
*/
public TestRepository(R db, RevWalk rw, MockSystemReader reader)
@@ -199,6 +203,16 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
/**
+ * Get instant
+ *
+ * @return current instant.
+ * @since 6.8
+ */
+ public Instant getInstant() {
+ return Instant.ofEpochMilli(mockSystemReader.getCurrentTime());
+ }
+
+ /**
* Get timezone
*
* @return timezone used for default identities.
@@ -235,6 +249,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* file content, will be UTF-8 encoded.
* @return reference to the blob.
* @throws Exception
+ * if an error occurred
*/
public RevBlob blob(String content) throws Exception {
return blob(content.getBytes(UTF_8));
@@ -247,6 +262,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* binary file content.
* @return the new, fully parsed blob.
* @throws Exception
+ * if an error occurred
*/
public RevBlob blob(byte[] content) throws Exception {
ObjectId id;
@@ -266,6 +282,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* a blob, previously constructed in the repository.
* @return the entry.
* @throws Exception
+ * if an error occurred
*/
public DirCacheEntry file(String path, RevBlob blob)
throws Exception {
@@ -276,6 +293,25 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
/**
+ * Construct a symlink mode tree entry.
+ *
+ * @param path
+ * path of the symlink.
+ * @param blob
+ * a blob, previously constructed in the repository.
+ * @return the entry.
+ * @throws Exception
+ * if an error occurred
+ * @since 6.3
+ */
+ public DirCacheEntry link(String path, RevBlob blob) throws Exception {
+ DirCacheEntry e = new DirCacheEntry(path);
+ e.setFileMode(FileMode.SYMLINK);
+ e.setObjectId(blob);
+ return e;
+ }
+
+ /**
* Construct a tree from a specific listing of file entries.
*
* @param entries
@@ -283,6 +319,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* to be sorted properly and may be empty.
* @return the new, fully parsed tree specified by the entry list.
* @throws Exception
+ * if an error occurred
*/
public RevTree tree(DirCacheEntry... entries) throws Exception {
final DirCache dc = DirCache.newInCore();
@@ -308,6 +345,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the path to find the entry of.
* @return the parsed object entry at this path, never null.
* @throws Exception
+ * if an error occurred
*/
public RevObject get(RevTree tree, String path)
throws Exception {
@@ -339,6 +377,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more IDs of the commit's parents.
* @return the ID of the new commit.
* @throws Exception
+ * if an error occurred
* @since 5.5
*/
public ObjectId unparsedCommit(ObjectId... parents) throws Exception {
@@ -355,6 +394,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more parents of the commit.
* @return the new commit.
* @throws Exception
+ * if an error occurred
*/
public RevCommit commit(RevCommit... parents) throws Exception {
return commit(1, tree(), parents);
@@ -371,6 +411,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more parents of the commit.
* @return the new commit.
* @throws Exception
+ * if an error occurred
*/
public RevCommit commit(RevTree tree, RevCommit... parents)
throws Exception {
@@ -389,6 +430,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more parents of the commit.
* @return the new commit.
* @throws Exception
+ * if an error occurred
*/
public RevCommit commit(int secDelta, RevCommit... parents)
throws Exception {
@@ -410,6 +452,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more parents of the commit.
* @return the new, fully parsed commit.
* @throws Exception
+ * if an error occurred
*/
public RevCommit commit(final int secDelta, final RevTree tree,
final RevCommit... parents) throws Exception {
@@ -432,6 +475,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* zero or more IDs of the commit's parents.
* @return the ID of the new commit.
* @throws Exception
+ * if an error occurred
* @since 5.5
*/
public ObjectId unparsedCommit(final int secDelta, final RevTree tree,
@@ -478,6 +522,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* object the tag should be pointed at.
* @return the new, fully parsed annotated tag object.
* @throws Exception
+ * if an error occurred
*/
public RevTag tag(String name, RevObject dst) throws Exception {
final TagBuilder t = new TagBuilder();
@@ -506,6 +551,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the target object.
* @return the target object.
* @throws Exception
+ * if an error occurred
*/
public RevCommit update(String ref, CommitBuilder to) throws Exception {
return update(ref, to.create());
@@ -516,12 +562,13 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
*
* @param ref
* the name of the reference to amend, which must already exist.
- * If {@code ref} does not start with {@code refs/} and is not the
- * magic names {@code HEAD} {@code FETCH_HEAD} or {@code
- * MERGE_HEAD}, then {@code refs/heads/} will be prefixed in front
- * of the given name, thereby assuming it is a branch.
+ * If {@code ref} does not start with {@code refs/} and is not
+ * the magic names {@code HEAD} {@code FETCH_HEAD} or {@code
+ * MERGE_HEAD}, then {@code refs/heads/} will be prefixed in
+ * front of the given name, thereby assuming it is a branch.
* @return commit builder that amends the branch on commit.
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder amendRef(String ref) throws Exception {
String name = normalizeRef(ref);
@@ -538,6 +585,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the id of the commit to amend.
* @return commit builder.
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder amend(AnyObjectId id) throws Exception {
return amend(pool.parseCommit(id), commit());
@@ -592,6 +640,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the target object.
* @return the target object.
* @throws Exception
+ * if an error occurred
*/
public <T extends AnyObjectId> T update(String ref, T obj) throws Exception {
ref = normalizeRef(ref);
@@ -614,9 +663,10 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* Delete a reference.
*
* @param ref
- * the name of the reference to delete. This is normalized
- * in the same way as {@link #update(String, AnyObjectId)}.
+ * the name of the reference to delete. This is normalized in the
+ * same way as {@link #update(String, AnyObjectId)}.
* @throws Exception
+ * if an error occurred
* @since 4.4
*/
public void delete(String ref) throws Exception {
@@ -656,6 +706,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* @param id
* ID of detached head.
* @throws Exception
+ * if an error occurred
* @see #reset(String)
*/
public void reset(AnyObjectId id) throws Exception {
@@ -677,13 +728,14 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
/**
* Soft-reset HEAD to a different commit.
* <p>
- * This is equivalent to {@code git reset --soft} in that it modifies HEAD but
- * not the index or the working tree of a non-bare repository.
+ * This is equivalent to {@code git reset --soft} in that it modifies HEAD
+ * but not the index or the working tree of a non-bare repository.
*
* @param name
- * revision string; either an existing ref name, or something that
- * can be parsed to an object ID.
+ * revision string; either an existing ref name, or something
+ * that can be parsed to an object ID.
* @throws Exception
+ * if an error occurred
*/
public void reset(String name) throws Exception {
RefUpdate.Result result;
@@ -717,6 +769,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* @return the new, fully parsed commit, or null if no work was done due to
* the resulting tree being identical.
* @throws Exception
+ * if an error occurred
*/
public RevCommit cherryPick(AnyObjectId id) throws Exception {
RevCommit commit = pool.parseCommit(id);
@@ -761,6 +814,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* Update the dumb client server info files.
*
* @throws Exception
+ * if an error occurred
*/
public void updateServerInfo() throws Exception {
if (db instanceof FileRepository) {
@@ -798,6 +852,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* parsing of.
* @return {@code object}
* @throws Exception
+ * if an error occurred
*/
public <T extends RevObject> T parseBody(T object) throws Exception {
pool.parseBody(object);
@@ -833,6 +888,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the object to tag
* @return the tagged object
* @throws Exception
+ * if an error occurred
*/
public ObjectId lightweightTag(String name, ObjectId obj) throws Exception {
if (!name.startsWith(Constants.R_TAGS))
@@ -850,8 +906,11 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the tips to start checking from; if not supplied the refs of
* the repository are used instead.
* @throws MissingObjectException
+ * if object is missing
* @throws IncorrectObjectTypeException
+ * if object has unexpected type
* @throws IOException
+ * if an IO error occurred
*/
public void fsck(RevObject... tips) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
@@ -904,6 +963,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* not removed.
*
* @throws Exception
+ * if an error occurred
*/
public void packAndPrune() throws Exception {
if (db.getObjectDatabase() instanceof ObjectDirectory) {
@@ -986,6 +1046,8 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
/**
+ * Create commit builder
+ *
* @return construct a new commit builder that updates this branch. If
* the branch already exists, the commit builder will have its
* first parent as the current commit and its tree will be
@@ -1004,6 +1066,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the commit to update to.
* @return {@code to}.
* @throws Exception
+ * if an error occurred
*/
public RevCommit update(CommitBuilder to) throws Exception {
return update(to.create());
@@ -1016,6 +1079,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the commit to update to.
* @return {@code to}.
* @throws Exception
+ * if an error occurred
*/
public RevCommit update(RevCommit to) throws Exception {
return TestRepository.this.update(ref, to);
@@ -1023,7 +1087,9 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
/**
* Delete this branch.
+ *
* @throws Exception
+ * if an error occurred
* @since 4.4
*/
public void delete() throws Exception {
@@ -1084,6 +1150,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* parent commit
* @return this commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder parent(RevCommit p) throws Exception {
if (parents.isEmpty()) {
@@ -1147,6 +1214,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* the file content
* @return this commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder add(String path, String content) throws Exception {
return add(path, blob(content));
@@ -1161,6 +1229,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* blob for this file
* @return this commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder add(String path, RevBlob id)
throws Exception {
@@ -1386,6 +1455,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
*
* @return child commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder child() throws Exception {
return new CommitBuilder(this);
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/MonotonicFakeClock.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/MonotonicFakeClock.java
index e5338d36cd..31db6a2c7b 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/MonotonicFakeClock.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/MonotonicFakeClock.java
@@ -40,7 +40,6 @@ public class MonotonicFakeClock implements MonotonicClock {
now += unit.toMillis(add);
}
- /** {@inheritDoc} */
@Override
public ProposedTimestamp propose() {
long t = now++;