Commit Graph

573 Commits

Author SHA1 Message Date
Matthias Sohn 38adb548c3 JGit v5.1.9.201908210455-r
Change-Id: Iaade207292acb8b27e01aca7e1af97ad7db1e854
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-21 10:52:10 +02:00
Matthias Sohn 3e2c88199f Merge branch 'stable-5.4'
* stable-5.4:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Upgrade tycho-extras to 1.4.0
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I709de5edb626536529a99220aae7751b127c9bff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-20 00:16:11 +02:00
Matthias Sohn 35d99477b8 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I43c2ab8b44c3e87d48e4072907ad169c81e3ffe0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-20 00:10:15 +02:00
Matthias Sohn 18fb58ae05 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: If0c5010a2cf151ebebb2f2088fac3ee02c5007b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-19 23:41:17 +02:00
Matthias Sohn 0eea7368e2 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I48c585f3c9287be7d6ddb6b01a1955444e13fa31
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-19 18:30:35 +02:00
Matthias Sohn f383206ace Cache user global and system-wide git configurations
So far the git configuration and the system wide git configuration were
always reloaded when jgit accessed these global configuration files to
access global configuration options which are not in the context of a
single git repository. Cache these configurations in SystemReader and
only reload them if their file metadata observed using FileSnapshot
indicates a modification.

Change-Id: I092fe11a5d95f1c5799273cacfc7a415d0b7786c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-08-18 11:47:26 +02:00
Matthias Sohn 7f92a70fb3 Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
FS determines FileStore attributes in a background thread and tries to
save the results to the global git configuration. This competed with
LocalDiskRepositoryTestCase#setup trying to save changes to the same
file requiring the same lock. This frequently led to one of the threads
failing to acquire the lock.

Fix this by first initiating determination of FileStore attributes which
then uses a MockSystemReader not using a userConfig stored to disk which
avoids this race for the lock.

Change-Id: I30fcd96bc15100f8ef9b2a9eb3320bb5ace97c67
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-16 16:51:45 +02:00
Matthias Sohn 9add6d3e24 Implement toString in MockSystemReader and MockConfig
This helps when debugging.

Change-Id: I3d72e1ea207ba60be77a7a9a840abb71ade1271c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-11 00:06:03 +02:00
Matthias Sohn c28167e103 Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
FS#getFileStoreAttributes used the real userConfig and not the mocked
one. This led to test errors when running tests with Bazel since it
sandboxes tests which prevents they can write to ~/.gitconfig.

Fix this by first preparing the MockedSystemReader and the mocked config
before calling FS#getFileStoreAttributes.

Also fix ConfigTest which broke due to this change since it inherits
from LocalDiskRepositoryTestCase and calls its setup method which was
changed here. We can no longer assert by comparing plain text since FS
adds FileStoreAttributes to the mocked userConfig. Also the default
options seen by this test changed since we now use a mocked config.

Change-Id: I76bc7c94953fe979266147d3b309a68dda9d4dfe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-11 00:06:03 +02:00
Matthias Sohn 65cee6ccbf Override FileBasedConfig's save method in MockConfig
This ensures we don't try to persist MockConfig using its superclasses
save() method which fails with an NPE since MockConfig has no backing
file.

Change-Id: Ifba2d24c9438bb30d3828ed31a4c131f940b45eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-10 23:57:21 +02:00
Matthias Sohn 3cea3676c7 Merge branch 'stable-5.4'
* stable-5.4: (82 commits)
  Export all packages of o.e.j.ant and o.e.j.archive bundles
  Do not require test bundles to export all packages
  Fix API problem filters
  Increase severity of AmbiguousMethodReference to ERROR
  [error prone] suppress AmbiguousMethodReference in AnyLongObjectId
  [error prone] fix ReferenceEquality warning in CommitBuilder
  [error prone] suppress NonAtomicVolatileUpdate warning in SimpleLruCache
  [error prone] fix ReferenceEquality warning in CommitGraphPane#authorFor
  [error prone] fix ReferenceEquality warning in RevWalk#isMergedInto
  [error prone] fix ReferenceEquality warning in RefUpdate#updateImpl
  [error prone] fix ReferenceEquality warning in static equals methods
  [error prone] suppress AmbiguousMethodReference in AnyObjectId
  [error prone] fix "FutureReturnValueIgnored" error in FS
  Fix formatting and add missing braces in Repository#stripWorkDir
  Repository: fix reference comparison of Files
  MergeAlgorithm: Suppress Error Prone warning about reference equality
  Fix NarrowingCompoundAssignment warnings from Error Prone
  FS_POSIX: handle Files.getFileStore() failures
  Fix OpenSshConfigTest#config
  FileSnapshot: fix bug with timestamp thresholding
  In LockFile#waitForStatChange wait in units of file time resolution
  Cache FileStoreAttributeCache per directory
  Fix FileSnapshot#save(long) and FileSnapshot#save(Instant)
  Persist minimal racy threshold and allow manual configuration
  Measure minimum racy interval to auto-configure FileSnapshot
  Reuse FileUtils to recursively delete files created by tests
  Fix FileAttributeCache.toString()
  Add test for racy git detection in FileSnapshot
  Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times
  Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
  Add missing javadoc in org.eclipse.jgit.junit
  Enhance RepeatRule to report number of failures at the end
  Fix FileSnapshotTests for filesystem with high timestamp resolution
  Retry deleting test files in FileBasedConfigTest
  Measure filesystem timestamp resolution already in test setup
  Refactor FileSnapshotTest to use NIO APIs
  Measure stored timestamp resolution instead of time to touch file
  Handle CancellationException in FileStoreAttributeCache
  Fix FileSnapshot#saveNoConfig
  Use Instant for smudge time in DirCache and DirCacheEntry
  Use Instant instead of milliseconds for filesystem timestamp handling
  Workaround SecurityException in FS#getFsTimestampResolution
  Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution
  FS: ignore AccessDeniedException when measuring timestamp resolution
  Add debug trace for FileSnapshot
  Use FileChannel.open to touch file and set mtime to now
  Persist filesystem timestamp resolution and allow manual configuration
  Increase bazel timeout for long running tests
  Bazel: Fix lint warning flagged by buildifier
  Update bazlets to latest version
  Bazel: Add missing dependencies for ArchiveCommandTest
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  Add support for nanoseconds and microseconds for Config#getTimeUnit
  Optionally measure filesystem timestamp resolution asynchronously
  Delete unused FileTreeIteratorWithTimeControl
  FileSnapshot#equals: consider UNKNOWN_SIZE
  Timeout measuring file timestamp resolution after 2 seconds
  Fix RacyGitTests#testRacyGitDetection
  GlobalBundleCache: Fix ClassNewInstance warning from Error Prone
  IncorrectObjectTypeException: Fix typos in constructors' Javadoc
  Change RacyGitTests to create a racy git situation in a stable way
  Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8
  Fix non-deterministic hash of archives created by ArchiveCommand
  Update Maven plugins ecj, plexus, error-prone
  Update Maven plugins and cleanup Maven warnings
  Make inner classes static where possible
  Error Prone: Increase severity of NonOverridingEquals to ERROR
  Error Prone: Increase severity of ImmutableEnumChecker to ERROR
  GitDateParser#ParseableSimpleDateFormat: Make formatStr private final
  BatchRefUpdateTest: Suppress ImmutableEnumChecker warning
  PacketLineIn: Suppress comparison warnings for END and DELIM
  FileSnapshot#toString: Suppress ReferenceEquality warnings
  Blame: Suppress ReferenceEquality warning for RevCommit instances
  Fix API problem filters
  pgm: add missing optional dependency to org.tukaani:xz
  NetscapeCookieFile: Make hash static and group overloaded write
  NetscapeCookieFile: Javadoc fixes
  Config: Handle reference-equality warning (and empty javadoc)
  Error Prone: Increase severity of ShortCircuitBoolean to ERROR
  ObjectWalk: Prefer boolean operators over logical operators in comparisons
  BasePackFetchConnection: Prefer boolean operators over logical operators in comparisons
  PackWriter: Prefer boolean operators over logical operators in comparisons

Change-Id: I825fd55bcb5345fb7afe066bf54ca50325f40acb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-09 14:32:02 +02:00
Matthias Sohn 8f7e851346 [error prone] suppress AmbiguousMethodReference in AnyObjectId
Move the implementation of the static equals() method to a new method
and suppress the error. Deprecate the old method to signal that we
intend to remove it in the next major release.

See https://errorprone.info/bugpattern/AmbiguousMethodReference

Change-Id: I5e29c97f4db3e11770be589a6ccd785e2c9ac7f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-08 23:39:23 +02:00
Matthias Sohn f54db4a857 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Fix OpenSshConfigTest#config
  FileSnapshot: fix bug with timestamp thresholding
  In LockFile#waitForStatChange wait in units of file time resolution
  Cache FileStoreAttributeCache per directory
  Fix FileSnapshot#save(long) and FileSnapshot#save(Instant)
  Persist minimal racy threshold and allow manual configuration
  Measure minimum racy interval to auto-configure FileSnapshot
  Reuse FileUtils to recursively delete files created by tests
  Fix FileAttributeCache.toString()
  Add test for racy git detection in FileSnapshot
  Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times
  Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
  Add missing javadoc in org.eclipse.jgit.junit
  Enhance RepeatRule to report number of failures at the end
  Fix FileSnapshotTests for filesystem with high timestamp resolution
  Retry deleting test files in FileBasedConfigTest
  Measure filesystem timestamp resolution already in test setup
  Refactor FileSnapshotTest to use NIO APIs
  Measure stored timestamp resolution instead of time to touch file
  Handle CancellationException in FileStoreAttributeCache
  Fix FileSnapshot#saveNoConfig
  Use Instant for smudge time in DirCache and DirCacheEntry
  Use Instant instead of milliseconds for filesystem timestamp handling
  Workaround SecurityException in FS#getFsTimestampResolution
  Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution
  FS: ignore AccessDeniedException when measuring timestamp resolution
  Add debug trace for FileSnapshot
  Use FileChannel.open to touch file and set mtime to now
  Persist filesystem timestamp resolution and allow manual configuration
  Increase bazel timeout for long running tests
  Bazel: Fix lint warning flagged by buildifier
  Update bazlets to latest version
  Bazel: Add missing dependencies for ArchiveCommandTest
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  Add support for nanoseconds and microseconds for Config#getTimeUnit
  Optionally measure filesystem timestamp resolution asynchronously
  Delete unused FileTreeIteratorWithTimeControl
  FileSnapshot#equals: consider UNKNOWN_SIZE
  Timeout measuring file timestamp resolution after 2 seconds
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8
  Fix non-deterministic hash of archives created by ArchiveCommand
  Update Maven plugins ecj, plexus, error-prone
  Update Maven plugins and cleanup Maven warnings
  Make inner classes static where possible
  Fix API problem filters

Change-Id: Iec3ad6ccc194582cb844310dc172c3103dae4457
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-08 13:24:14 +02:00
Matthias Sohn 718555518d Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Fix OpenSshConfigTest#config
  FileSnapshot: fix bug with timestamp thresholding
  In LockFile#waitForStatChange wait in units of file time resolution
  Cache FileStoreAttributeCache per directory
  Fix FileSnapshot#save(long) and FileSnapshot#save(Instant)
  Persist minimal racy threshold and allow manual configuration
  Measure minimum racy interval to auto-configure FileSnapshot
  Reuse FileUtils to recursively delete files created by tests
  Fix FileAttributeCache.toString()
  Add test for racy git detection in FileSnapshot
  Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times
  Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
  Add missing javadoc in org.eclipse.jgit.junit
  Enhance RepeatRule to report number of failures at the end
  Fix FileSnapshotTests for filesystem with high timestamp resolution
  Retry deleting test files in FileBasedConfigTest
  Measure filesystem timestamp resolution already in test setup
  Refactor FileSnapshotTest to use NIO APIs
  Measure stored timestamp resolution instead of time to touch file
  Handle CancellationException in FileStoreAttributeCache
  Fix FileSnapshot#saveNoConfig
  Use Instant for smudge time in DirCache and DirCacheEntry
  Use Instant instead of milliseconds for filesystem timestamp handling
  Workaround SecurityException in FS#getFsTimestampResolution
  Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution
  FS: ignore AccessDeniedException when measuring timestamp resolution
  Add debug trace for FileSnapshot
  Use FileChannel.open to touch file and set mtime to now
  Persist filesystem timestamp resolution and allow manual configuration
  Increase bazel timeout for long running tests
  Bazel: Fix lint warning flagged by buildifier
  Update bazlets to latest version
  Bazel: Add missing dependencies for ArchiveCommandTest
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  Add support for nanoseconds and microseconds for Config#getTimeUnit
  Optionally measure filesystem timestamp resolution asynchronously
  Delete unused FileTreeIteratorWithTimeControl
  FileSnapshot#equals: consider UNKNOWN_SIZE
  Timeout measuring file timestamp resolution after 2 seconds
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Deprecate Constants.CHARACTER_ENCODING in favor of
StandardCharsets.UTF_8
  Fix non-deterministic hash of archives created by ArchiveCommand
  Update Maven plugins ecj, plexus, error-prone
  Update Maven plugins and cleanup Maven warnings
  Make inner classes static where possible
  Fix API problem filters

Change-Id: I238adfd3080a5fed9d64c3c757297da6ea893918
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-08 13:04:38 +02:00
Matthias Sohn 0046b2a8fe Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Fix OpenSshConfigTest#config
  FileSnapshot: fix bug with timestamp thresholding
  In LockFile#waitForStatChange wait in units of file time resolution
  Cache FileStoreAttributeCache per directory
  Fix FileSnapshot#save(long) and FileSnapshot#save(Instant)
  Persist minimal racy threshold and allow manual configuration
  Measure minimum racy interval to auto-configure FileSnapshot
  Reuse FileUtils to recursively delete files created by tests
  Fix FileAttributeCache.toString()
  Add test for racy git detection in FileSnapshot
  Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times
  Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
  Add missing javadoc in org.eclipse.jgit.junit
  Enhance RepeatRule to report number of failures at the end
  Fix FileSnapshotTests for filesystem with high timestamp resolution
  Retry deleting test files in FileBasedConfigTest
  Measure filesystem timestamp resolution already in test setup
  Refactor FileSnapshotTest to use NIO APIs
  Measure stored timestamp resolution instead of time to touch file
  Handle CancellationException in FileStoreAttributeCache
  Fix FileSnapshot#saveNoConfig
  Use Instant for smudge time in DirCache and DirCacheEntry
  Use Instant instead of milliseconds for filesystem timestamp handling
  Workaround SecurityException in FS#getFsTimestampResolution
  Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution
  FS: ignore AccessDeniedException when measuring timestamp resolution
  Add debug trace for FileSnapshot
  Use FileChannel.open to touch file and set mtime to now
  Persist filesystem timestamp resolution and allow manual configuration
  Increase bazel timeout for long running tests
  Bazel: Fix lint warning flagged by buildifier
  Update bazlets to latest version
  Bazel: Add missing dependencies for ArchiveCommandTest
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  Add support for nanoseconds and microseconds for Config#getTimeUnit
  Optionally measure filesystem timestamp resolution asynchronously
  Delete unused FileTreeIteratorWithTimeControl
  FileSnapshot#equals: consider UNKNOWN_SIZE
  Timeout measuring file timestamp resolution after 2 seconds
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8
  Fix non-deterministic hash of archives created by ArchiveCommand
  Update Maven plugins ecj, plexus, error-prone
  Update Maven plugins and cleanup Maven warnings
  Make inner classes static where possible
  Fix API problem filters

Change-Id: Ia57385b2a60f48a5317c8d723721c235d7043a84
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-08 11:54:56 +02:00
Matthias Sohn d45219baac Persist minimal racy threshold and allow manual configuration
To enable persisting the minimal racy threshold per FileStore add a
new config option to the user global git configuration:

- Config section is "filesystem"
- Config subsection is concatenation of
  - Java vendor (system property "java.vendor")
  - Java version (system property "java.version")
  - FileStore's name, on Windows we use the attribute volume:vsn instead
    since  the name is not necessarily unique.
  - separated by '|'
  e.g.
    "AdoptOpenJDK|1.8.0_212-b03|/dev/disk1s1"
  The same prefix is used as for filesystem timestamp resolution, so
  both values are stored in the same config section
- The config key for minmal racy threshold is "minRacyThreshold" as a
  time value, supported time units are those supported by
  DefaultTypedConfigGetter#getTimeUnit
- measure for 3 seconds to limit runtime which depends on hardware, OS
  and Java version being used

If the minimal racy threshold is configured for a given FileStore the
configured value is used instead of measuring it.

When the minimal racy threshold was measured it is persisted in the user
global git configuration.

Rename FileStoreAttributeCache to FileStoreAttributes since this class
is now declared public in order to enable exposing all attributes in one
object.

Example:

[filesystem "AdoptOpenJDK|11.0.3|/dev/disk1s1"]
	timestampResolution = 7000 nanoseconds
	minRacyThreshold = 3440 microseconds

Change-Id: I22195e488453aae8d011b0a8e3276fe3d99deaea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Also-By: Marc Strapetz <marc.strapetz@syntevo.com>
2019-08-06 14:54:39 +02:00
Matthias Sohn 5911521ba6 Measure minimum racy interval to auto-configure FileSnapshot
By running FileSnapshotTest#detectFileModified we found that the sum of
measured filesystem timestamp resolution and measured clock resolution
may yield a too small interval after a file has been modified which we
need to consider racily clean. In our tests we didn't find this behavior
on all systems we tested on, e.g. on MacOS using APFS and Java 8 and 11
this effect was not observed.

On Linux (SLES 15, kernel 4.12.14-150.22-default) we collected the
following test results using Java 8 and 11:

In 23-98% of 10000 test runs (depending on filesystem type and Java
version) the test failed, which means the effective interval which needs
to be considered racily clean after a file was modified is larger than
the measured file timestamp resolution.

"delta" is the observed interval after a file has been modified but
FileSnapshot did not yet detect the modification:

"resolution" is the measured sum of file timestamp resolution and clock
resolution seen in Java.

Java version    filesystem  failures resolution  min delta   max delta
1.8.0_212-b04   btrfs	    98.6%       1 ms        3.6 ms      6.6 ms
1.8.0_212-b04   ext4        82.6%       3 ms        1.1 ms      4.1 ms
1.8.0_212-b04   xfs         23.8%       4 ms        3.7 ms      3.9 ms
1.8.0_212-b04   zfs         23.1%       3 ms        4.8 ms      5.0 ms
11.0.3+7        btrfs       98.1%       3 us        0.7 ms      4.7 ms
11.0.3+7        ext4        98.1%       6 us        0.7 ms      4.7 ms
11.0.3+7        xfs         98.5%       7 us        0.1 ms      8.0 ms
11.0.3+7        zfs         98.4%       7 us        0.7 ms      5.2 ms

Mac OS
1.8.0_212       APFS        0%          1 s
11.0.3+7        APFS        0%          6 us

The observed delta is not distributed according to a normal gaussian
distribution but rather random in the observed range between "min delta"
and "max delta".

Run this test after measuring file timestamp resolution in
FS.FileAttributeCache to auto-configure JGit since it's unclear what
mechanism is causing this effect.

In FileSnapshot#isRacyClean use the maximum of the measured timestamp
resolution and the measured "delta" as explained above to decide if a
given FileSnapshot is to be considered racily clean. Add a 30% safety
margin to ensure we are on the safe side.

Change-Id: I1c8bb59f6486f174b7bbdc63072777ddbe06694d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-08-06 14:54:35 +02:00
Matthias Sohn 902935c38c Reuse FileUtils to recursively delete files created by tests
Replace redundant complex implementation of recursive delete by the one
in FileUtils.

Change-Id: Iced1468b96c4f32381a9cf0c651b2bf6a9a9af35
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-26 15:53:33 +02:00
Matthias Sohn 773cbb5f63 Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
Use the same JDT core settings as used in org.eclipse.jgit but ignore
non-externalized strings.

Change-Id: If30013c76a197e571601a8abc882ac6a99592374
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-24 16:21:53 +02:00
Matthias Sohn 376c20f454 Add missing javadoc in org.eclipse.jgit.junit
Change-Id: Ib709ef050bec31c87f542fb2cc977863dda93ef9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-24 16:21:48 +02:00
Matthias Sohn ba5d13ed42 Enhance RepeatRule to report number of failures at the end
In order to enable counting how frequently a test fails if repeated add
option abortOnFailure. If it is true the test aborts on the first
failure. Otherwise it runs the configured number of repetitions and, if
there was any failure, throws a RepeatException reporting how many of
the test repetitions failed.

Change-Id: Ic47de44d4a6273fddf04b9993ad989903efb40c3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-19 14:45:56 +02:00
Matthias Sohn eda2e95fa8 Measure filesystem timestamp resolution already in test setup
This helps to avoid some time critical tests can't prepare the test
fixture intended since measuring timestamp resolution takes time.

Change-Id: Ib34023e682a106070ca97e98ef16789a4dfb97b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-19 14:45:55 +02:00
Matthias Sohn 95e8264cc8 Use Instant instead of milliseconds for filesystem timestamp handling
This enables higher file timestamp resolution on filesystems like ext4,
Mac APFS (1ns) or NTFS (100ns) providing high timestamp resolution on
filesystem level.

Note:
- on some OSes Java 8,9 truncate milliseconds, see
https://bugs.openjdk.java.net/browse/JDK-8177809, fixed in Java 10
- UnixFileAttributes truncates timestamp resolution to microseconds when
converting the internal representation to FileTime exposed in the API,
see https://bugs.openjdk.java.net/browse/JDK-8181493
- WindowsFileAttributes also provides only microsecond resolution

Change-Id: I25ffff31a3c6f725fc345d4ddc2f26da3b88f6f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-07-18 03:27:52 +02:00
Michael Keppler 4b0c192f2d Fix bundle localization of Apache SSH bundle
The placeholders in manifest and plugin.properties did not match. To
avoid similar issues, all placeholders have been changed to
Bundle-Vendor and Bundle-Name now.

Bug:548503
Change-Id: Ibd4b9bc237b323e614506b97e5fbc99416365040
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-06-21 17:54:06 +02:00
David Pursehouse 6d0168a414 Make inner classes static where possible
As reported by Error Prone:

An inner class should be static unless it references members of its
enclosing class. An inner class that is made non-static unnecessarily
uses more memory and does not make the intent of the class clear.

See https://errorprone.info/bugpattern/ClassCanBeStatic

Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit ee40efcea4)
2019-06-17 07:48:34 +02:00
Matthias Sohn 16fd3feefc Prepare 5.5.0-SNAPSHOT builds
Change-Id: I177d637e552a79014816dc5d2ef5ccda506adb39
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-13 03:01:15 +02:00
Matthias Sohn f3b7c2beae Prepare 5.4.1-SNAPSHOT builds
Change-Id: I8620d03c1cd5c1d0ad04e7607553e9aa18def9bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-12 17:35:11 +02:00
Matthias Sohn 3dad0682be JGit v5.4.0.201906121030-r
Change-Id: Ie68828af68d07cf8e3fe778d39436f539f1c73d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-12 16:29:11 +02:00
Matthias Sohn 0e9361f066 JGit v5.4.0.201906120450-r
Change-Id: Iea17cba848d4e53d69d34e952a2476c375721aa4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-12 10:50:14 +02:00
Matthias Sohn d9c569b747 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Prepare 5.3.3-SNAPSHOT builds
  JGit v5.3.2.201906051522-r
  Prepare 5.1.9-SNAPSHOT builds
  JGit v5.1.8.201906050907-r
  Test detecting modified packfiles
  Enhance fsTick() to use filesystem timer resolution
  Add debug trace to measure time needed to open pack index
  Extend FileSnapshot for packfiles to also use checksum to detect changes
  Wait opening new packfile until it can't be racy anymore
  Avoid null PackConfig in GC
  Add FileSnapshot test testing recognition of file size changes
  Capture reason for result of FileSnapshot#isModified
  Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows
  Tune max heap size for tests
  Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc
  ObjectDirectory: fix closing of obsolete packs
  Update API filters for methods added to fix bugs
  Bazel: Increase severity of most error-prone checks to ERROR
  Enable error-prone checks by default
  Add bazel options to align with gerrit's
  Include filekey file attribute when comparing FileSnapshots
  Measure file timestamp resolution used in FileSnapshot
  Fix FileSnapshot's consideration of file size
  Fix API problem filters
  Fix API problem filters

Change-Id: Ie1c7e4752661aec9e1754660934921224e2408eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-06 17:14:31 +02:00
Matthias Sohn fcfe1299c3 Prepare 5.3.3-SNAPSHOT builds
Change-Id: Idebf272835cb22c21257c88b414ada802629b665
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-05 23:35:14 +02:00
Matthias Sohn d6c7c42a1b JGit v5.3.2.201906051522-r
Change-Id: I41b4926f4bfa896ef2a13c35e93e08071ae949a3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-05 21:23:13 +02:00
Matthias Sohn 60d65bbd22 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Prepare 5.1.9-SNAPSHOT builds
  JGit v5.1.8.201906050907-r
  Test detecting modified packfiles
  Enhance fsTick() to use filesystem timer resolution
  Add debug trace to measure time needed to open pack index
  Extend FileSnapshot for packfiles to also use checksum to detect changes
  Wait opening new packfile until it can't be racy anymore
  Avoid null PackConfig in GC
  Add FileSnapshot test testing recognition of file size changes
  Capture reason for result of FileSnapshot#isModified
  Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows
  Tune max heap size for tests
  Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc
  ObjectDirectory: fix closing of obsolete packs
  Include filekey file attribute when comparing FileSnapshots
  Measure file timestamp resolution used in FileSnapshot
  Fix FileSnapshot's consideration of file size
  Fix API problem filters
  Fix API problem filters

Change-Id: Id79a3a19f9a31dff94d10a406c2b6e08a506931a
2019-06-05 21:18:47 +02:00
Matthias Sohn 4018709eb9 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Prepare 5.1.9-SNAPSHOT builds
  JGit v5.1.8.201906050907-r
  Test detecting modified packfiles
  Enhance fsTick() to use filesystem timer resolution
  Add debug trace to measure time needed to open pack index
  Extend FileSnapshot for packfiles to also use checksum to detect changes
  Wait opening new packfile until it can't be racy anymore
  Avoid null PackConfig in GC
  Add FileSnapshot test testing recognition of file size changes
  Capture reason for result of FileSnapshot#isModified
  Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows
  Tune max heap size for tests
  Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc
  ObjectDirectory: fix closing of obsolete packs
  Include filekey file attribute when comparing FileSnapshots
  Measure file timestamp resolution used in FileSnapshot
  Fix FileSnapshot's consideration of file size
  Fix API problem filters

Change-Id: I3ac77bfa03f7436de12ab86e1bba29afee5ccd01
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-05 20:58:16 +02:00
Matthias Sohn 57ccca75e6 Prepare 5.1.9-SNAPSHOT builds
Change-Id: I60571e4e0bea04bb2c25ef3d0332a9ab6895db06
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-05 15:23:56 +02:00
Matthias Sohn 2fe587fcfd JGit v5.1.8.201906050907-r
Change-Id: Iae0ffe161df2ca8a800d21688d6b7d7419dfb640
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-05 15:06:56 +02:00
Christian Halstrick b2ee9cfbc3 Enhance fsTick() to use filesystem timer resolution
RepositoryTestCase.fsTick() was was waiting 64, 128, 256, ... milliseconds
until it detected that the filesystem timer has ticked. Make use of
the filesystemtimer resolution information in FS to sleep a fraction
of the filesystem timer resolution. That raises probability to wake up
shortly after the filesystem timer has ticked.

Change-Id: Ibcc38576e42ece13b2fd4423a29c459eed167a69
2019-06-05 00:48:07 +02:00
Matthias Sohn 0988276746 Prepare 5.4.0-SNAPSHOT builds
Change-Id: I9df6fccee253d4087f9afab4cb46e0a40b8a5699
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 22:52:43 +02:00
Matthias Sohn 72998dd5ee JGit v5.4.0.201905221418-m3
Change-Id: I8a7e687acfcf8c341abd726ae60b5ee173422215
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 20:18:14 +02:00
Matthias Sohn b513b77477 Measure file timestamp resolution used in FileSnapshot
FileSnapshot.notRacyClean() assumed a worst case filesystem timestamp
resolution of 2.5 sec (FAT has a resolution of 2 sec). Instead measure
timestamp resolution to avoid unnecessary IO caused by false positives
in detecting the racy git problem caused by finite filesystem timestamp
resolution [1].

Cache the measured resolution per FileStore since timestamp resolution
depends on the respective filesystem type. If timestamp resolution
cannot be measured or fails due to an exception fallback to the worst
case FAT timestamp resolution and avoid caching this value.

Add a 10% safety margin in FileSnapshot.notRacyClean(), though running
FsTest.testFsTimestampResolution() 1000 times which is not using a
safety margin didn't fail on Mac using APFS and Java 8, 11, 12.

Measured Java file timestamp resolution: [2]

[1] https://github.com/git/git/blob/master/Documentation/technical/racy-git.txt
[2] https://docs.google.com/spreadsheets/d/1imy0y6WmRqBf0kjCxzxj2X7M50eIVfa7oaUIzEOHmjo

Bug: 546891
Change-Id: I493f3b57b6b306285ffa7d392339d253e5966ab8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:13:22 +02:00
Carsten Hammer 84fc5c908d Convert to lambda or member reference
Convert anonymous inner classes to lambda expressions or member
references

Bug: 545856
CQ: 19537
Change-Id: I621431c178e8b99316314602f7c66c9a36f9ae98
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-16 02:58:43 -04:00
Matthias Sohn 1342942cc8 Prepare 5.3.2-SNAPSHOT builds
Change-Id: Iedd56602acc89783387098c7f92ce0e5bad091e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-28 00:54:08 +02:00
Matthias Sohn 38049a008d JGit v5.3.1.201904271842-r
Change-Id: If3c323acfd2b6933f7d4fbec480cd4e82224f701
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-28 00:41:59 +02:00
Matthias Sohn a72e0b0188 Prepare 5.2.3-SNAPSHOT builds
Change-Id: I6ae3db901d986467128326073d4ba70406ae8385
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-24 00:04:44 +02:00
Matthias Sohn 1d297c3ddc JGit v5.2.2.201904231744-r
Change-Id: I4ed2aff28bff702a8c1b42814acb04c7ef9025a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-23 23:43:50 +02:00
Matthias Sohn c2945bd261 Prepare 5.1.8-SNAPSHOT builds
Change-Id: I331bbaefd42ef94673ae8565c9b2b3af9eadfda0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-20 10:51:17 +02:00
Matthias Sohn 22e41cfd56 JGit v5.1.7.201904200442-r
Change-Id: Ifaa3a88c5e117912a8c691b8b8369dd9a17faebb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-20 10:42:58 +02:00
Carsten Hammer 6e03645ad8 Use jdk 5 for loop
Replace simple uses of Iterator with a corresponding for-loop.
Also add missing braces on loops as necessary.

Change-Id: I708d82acdf194787e3353699c07244c5ac3de189
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-13 19:33:13 +02:00
Carsten Hammer c0268f899e Join catch sections using multicatch
Change-Id: I1a9112e6a4f938638c599b489cb0858eca27ab91
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-13 18:53:58 +02:00
Carsten Hammer 0db509f7e7 Use String.isEmpty() instead of comparing to ""
Use of String.equals("") can be replaced with with String.length() == 0
(for JDK5 and lower) or String.isEmpty() (for JDK6 and higher)

Change-Id: Id1462d22c5d249485d87993263a9239809e73c55
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-04-11 11:48:31 +09:00
David Pursehouse ee32ca226e LocalDiskRepositoryTestCase: Clarify semantics of repository creation methods
Several of the utility methods create a Repository without setting
the 'autoClose' flag, which means that the caller is responsible for
closing it. Update the Javadoc to explicitly mention this.

Change-Id: I2410dd8d230cd4519f756c38b17141d0daa6c314
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-04-08 01:13:01 +02:00
Matthias Sohn 27f1fb668f Add missing source bundles and add them to a single source feature
Add missing source bundles for
- org.eclipse.jgit.ant
- org.eclipse.jgit.archive
- org.eclipse.jgit.http.apache
- org.eclipse.jgit.http.server
- org.eclipse.jgit.junit
- org.eclipse.jgit.junit.http
- org.eclipse.jgit.junit.ssh
- org.eclipse.jgit.lfs
- org.eclipse.jgit.lfs.server
- org.eclipse.jgit.ui

Combine all source bundles into a single source feature
org.eclipse.jgit.source and delete the other source features.

Ensure all bundles are added to the jgit p2 repository.

Change-Id: I56785f49c940b79f41f763c26e63a4a820ed7cce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-02 01:57:28 -04:00
Matthias Sohn 4ade2de34f Prepare 5.3.1-SNAPSHOT builds
Change-Id: I8dc5e47bd19809d684579610edf922abca3cb3cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 15:10:33 +01:00
Matthias Sohn de4a633201 JGit v5.3.0.201903130848-r
Change-Id: I52256a6d07011030698299d9a97dd01ea825fb7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 13:47:54 +01:00
Matthias Sohn 639d53721c Prepare 5.1.7-SNAPSHOT builds
Change-Id: Ica716b2ad18f8390e75466430ef81c86ea06f004
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 07:49:33 +01:00
Matthias Sohn a31756fbfc JGit v5.1.6.201903130242-r
Change-Id: Iaf5e451f72dc8512afee99a9f3fb91aa348e3cf5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 07:41:27 +01:00
Matthias Sohn 90107d53eb Prepare 5.4.0-SNAPSHOT builds
Change-Id: I90a4791f63d0eba23da744c720e869f1830b86e7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-07 00:34:14 +01:00
Matthias Sohn 0295ee1164 Prepare 5.3.0-SNAPSHOT builds
Change-Id: I9b934bcfad3d2091f4da163170348b0c8ef5e732
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-06 22:26:03 +01:00
Matthias Sohn aca889f8cc JGit v5.3.0.201903061415-rc1
Change-Id: I85866af97fe1c0c0a0da83a7605484082fa56b52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-06 20:03:00 +01:00
David Pursehouse 52923e9b07 LocalDiskRepositoryTestCase#createRepository: Default auto-close to false
Since 8ed59c5 ("Make TestRepository AutoCloseable", Jan 11, 2019) the
TestRepository class is auto-closeable, but instantiations of it were
not converted to use try-with-resource.

Converting to try-with-resource results, in several cases, in the
repository being closed twice because LocalDiskRepositoryTestCase has
logic to close created repositories in the tearDown method. This results
in several tests emitting a warning to the console:

  close() called when useCnt is already zero

Change the default behavior of the createRepository method to not use
the auto-close logic in LocalDiskRepositoryTestCase, so that thy will
instead be closed (only once) using the AutoCloseable implementation.

Deprecate the method that has the autoClose parameter.

Change-Id: I63d62c9913f9b61271667861dae144e551d358c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 20:09:16 +09:00
Jackson Toeniskoetter 8ed59c511c Make TestRepository AutoCloseable
Currently, unit tests need to either close the Repository underlying a
TestRepository manually, or not close it at all. Both are error prone.

The TestRepository holds a reference to 4 AutoCloseable objects:
Repository, ObjectInserter, Git, and RevWalk. The last two can escape
the TestRepository scope, so they are not closed when TestRepository is
closed.

Change-Id: I4461bb9104d517bd6bef09c38507c7c2ef5c31d4
Signed-off-by: Jackson Toeniskoetter <jackdt@google.com>
2019-01-10 12:10:43 -08:00
Matthias Sohn 56562221d6 Prepare 5.2.2-SNAPSHOT builds
Change-Id: I9487f6a59ed684ad13bcfbff7d6c730ae4f37030
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 03:32:48 +01:00
Matthias Sohn 24e89950e7 JGit v5.2.1.201812262042-r
Change-Id: Idfefc54e898f364407a931b787a26db2489b031c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 02:44:17 +01:00
Matthias Sohn fafad4196d Prepare 5.1.6-SNAPSHOT builds
Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:35:30 +01:00
Matthias Sohn 510011b05c JGit v5.1.5.201812261915-r
Change-Id: I249a440d1ca1c997343da942ae55fcb27a645b92
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:16:15 +01:00
Matthias Sohn d14209e81b Prepare 5.1.5-SNAPSHOT builds
Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:57:01 +01:00
Matthias Sohn c93aec2b73 JGit v5.1.4.201812251853-r
Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:53:51 +01:00
Matthias Sohn 57b8cf4261 Prepare 5.2.1-SNAPSHOT builds
Change-Id: I68d9f5b1c8ca8e8eada9143093dc4fa82519edd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-07 01:46:38 +01:00
Matthias Sohn c84c08107d JGit v5.2.0.201812061821-r
Change-Id: I8528c913ad1a820ee9a2fa6be1c9125b518caefe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-07 00:20:43 +01:00
Matthias Sohn 38da21d6b0 Prepare 5.3.0-SNAPSHOT builds
Change-Id: I8951c2cf650cc3e41d2baa0b330b94468cfed5c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-03 02:32:49 +01:00
Matthias Sohn 055c312bd1 Prepare 5.2.0-SNAPSHOT builds
Change-Id: I18646aaeee51047b234b758dcc1c2f89fd01b2f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-30 22:57:04 +01:00
Matthias Sohn 12d840dfcb JGit v5.2.0.201811281532-m3
Change-Id: I79988b473d67e565d8f6bcac40ee9a14b26c9e60
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 21:35:26 +01:00
Thomas Wolf 1316d43e51 Move SshTestGitServer to new bundle org.eclipse.jgit.junit.ssh
Create the bundle and move the SshTestGitServer there. Verified that
the Eclipse build still works and ran JSchSshTest and ApacheSshTest as
junit tests inside Eclipse.

Update maven build and features to account for that. Verified by
running full maven build including packaging.

Update bazel build files to account for that. Verified by a
clean-slate bazel build :all, followed by running the JSchSshTest
and the ApacheSshTest via bazel.

Change-Id: Ia084942f4425b454529de148e00417e7da786a90
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-17 07:28:08 -08:00
Thomas Wolf ec1116627f Apache MINA sshd client: properly handle HostKeyAlgorithms config
By default sshd will use its default built-in list, which matches
the one of openssh (as far as the algorithms exist in sshd at all).
But it doesn't handle HostKeyAlgorithms from the ssh config at all.

Implement this as in openssh, including the '+' and '-' modifiers
and reordering the default if there are known host keys for a
server already.

Add tests for the reordering.

Also use a more robust reader for the known hosts file. The default
aborts on the first error.

Bug: 520927
Change-Id: Ib1684440bfe2e96140536aa1a93c4bd4a0d35916
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-13 10:49:26 -08:00
Thomas Wolf 8001f4c1fe Apache MINA sshd client: add gssapi-with-mic authentication
sshd does support gssapi-with-mic on the server side, but has no
built-in client-side support for this authentication mechanism.

Add our own implementation for it, following RFC 4462.[1] To avoid
needlessly re-trying mechanisms that aren't even configured on the
client, we disable mechanisms that fail on the very first attempt
to use them.

Since we have no real Kerberos5 test setup, this cannot be fully
tested in CI. The disabling of the authentication mechanism and
that it is skipped when not successful _is_ tested.

[1] https://www.ietf.org/rfc/rfc4462.txt

Bug: 520927
Change-Id: I5d0cdb14103588a57c52f927df541b589ab88d88
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-13 10:49:26 -08:00
Thomas Wolf 0173b25415 Add more ssh tests: pushing, known_host file handling, etc.
Add support for git-receive-pack to the ssh git server and add two
new tests for pushing.

This actually uncovered an undocumented requirement in TransportSftp:
the FTP rename operation assumes POSIX semantics, i.e., that the
target is removed. This works as written only for servers that
support and advertise the "posix-rename@openssh.com" FTP extension.

Our little Apache MINA server does not advertise this extension.

Fix the FtpChannel implementation for Jsch to handle this case in a
meaningful way so that it can pass the new "push over sftp" test.

Add more tests to test the behavior of server host key checking.

Also refactor the tests generally to separate better the test
framework from the actual tests.

Bug: 520927
Change-Id: Ia4bb85e17ddacde7b36ee8c2d5d454bbfa66dfc3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-13 10:49:26 -08:00
Thomas Wolf 08b0a8632d Ssh tests with an Apache MINA sshd test git server
Add a simple ssh git server based on Apache MINA sshd, and use it
in new tests that verify ssh operations and in particular a number
of bugs that had cropped up over time in JSch.

The git server supports fetching only, and sftp access.

The tests are all in an abstract base class; the concrete JschSshTest
class only provides ssh-specific test setup. So the same tests could
be run easily also with some other ssh client.

Bug: 520927
Change-Id: Ide6687b717fb497a29fc83f22b07390a26dfce1d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-06 13:17:21 +01:00
Thomas Wolf bb5180469c Fix test setup for Eclipse Photon and greater
When a source folder is marked as a test folder, JDT requires that it
has an output folder different from the one used for regular sources.
Therefore give the test folders in org.eclipse.jgit.test a separate
output folder "bin-tst".

Moreover JDT reports errors if non-test classes have dependencies on
test classes. Therefore remove the "test" annotation from
org.eclipse.jgit.junit.

Change-Id: Ib527439ff5b7d7b570b8a60819ecaa70f59c63a3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-02 18:50:26 +01:00
Matthias Sohn b65e247568 Prepare 5.1.4-SNAPSHOT builds
Change-Id: Iee86860f3b4eb9f4af818c60342fd29465c0474c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 10:39:16 +02:00
Matthias Sohn cf24983b23 JGit v5.1.3.201810200350-r
Change-Id: Ib2c5a79d4fdf77680b7b65652fc3659527df27ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 09:50:16 +02:00
Michael Keppler 91021cb66f Configure classpath for separate test sources in Eclipse
Eclipse Photon supports separating sources and test sources.

There are no functional changes in the IDE, except for test source
folders having a different icon color.

Users of different IDEs than Eclipse are not affected, since the
attribute on the classpath entries will be ignored by their IDE.

Bug: 539933
Change-Id: Iac6dcdf0c0730ca775bae90df6a685303dc95380
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-10-17 11:08:24 +09:00
David Pursehouse 7ebd434e91 Disable Eclipse warning about unrecognized @SuppressWarnings value
The code base has several @SuppressWarnings annotations to suppress
warnings raised by Error Prone, but those are not recognized by
Eclipse and there is currently no way to tell it about them [1].

Suppress them for now.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392045

Change-Id: I3de7cfa8ad4370ca5be71e1303879c73ab6829c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-10-17 10:40:36 +09:00
Matthias Sohn 1133faff8c Merge branch 'stable-5.1'
* stable-5.1:
  Prepare 5.1.3-SNAPSHOT builds
  JGit v5.1.2.201810061102-r
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options
  Revert "Configure WindowCache settings to use in JGit CLI"

Change-Id: I833d30d6de75b097377872c000b2ef5a1b96cf89
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 19:28:51 +02:00
Matthias Sohn 2078b23cee Prepare 5.1.3-SNAPSHOT builds
Change-Id: I75c1a01885115fc709ab37f181234264c3f7423a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 18:54:50 +02:00
Matthias Sohn b63870200b JGit v5.1.2.201810061102-r
Change-Id: Id34e4ae12a796460862edc37c5eb072314199bf4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 17:10:45 +02:00
David Pursehouse ee40efcea4 Make inner classes static where possible
As reported by Error Prone:

An inner class should be static unless it references members of its
enclosing class. An inner class that is made non-static unnecessarily
uses more memory and does not make the intent of the class clear.

See https://errorprone.info/bugpattern/ClassCanBeStatic

Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:31:13 +09:00
Michael Keppler 751abf4a50 Fix Mylyn commit message template
The commit message template contains a superfluous blank at the end of
the first line, which is deleted by this change. This is only relevant
for jgit contributors using Eclipse, not for jgit users.

Change-Id: I462deb49c26fb64b3dc2d1d75f1e40ef302b0fc9
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2018-09-23 04:11:58 -04:00
Matthias Sohn 48e21dc10b Prepare 5.1.2-SNAPSHOT builds
Change-Id: I095d246e27de747a234bc058725454c222be51ce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 17:03:49 +02:00
Matthias Sohn b06d2e6a31 JGit v5.1.1.201809181055-r
Change-Id: I2366444fca125139eadb6d513be721167a266d70
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:55:20 +02:00
Matthias Sohn a44d95c814 Prepare 5.1.1-SNAPSHOT builds
Change-Id: Ie220dd95fae18f894e2a04a5ae6d29a1e5a6d76b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-11 23:28:07 +02:00
Matthias Sohn 47956bcc68 JGit v5.1.0.201809111528-r
Change-Id: I583bf7d60bccc876156be1f605bfda32b89cd08b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-11 21:30:23 +02:00
Matthias Sohn 2fae326aa9 Prepare 5.2.0-SNAPSHOT builds
Change-Id: If8e8ca20e745901a5e0239c16cb4acc7934b4ec8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-06 09:36:00 +02:00
Matthias Sohn 4c8a4eb8fd Prepare 5.1.0-SNAPSHOT builds
Change-Id: I3d06c5237edae54b09f465f415f5a308b5e7ceff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-05 20:41:53 +02:00
Matthias Sohn e4281f1d5f JGit v5.1.0.201809051400-rc1
Change-Id: I0b53f95ee51d94da8b029c9bb10eb854ff9dd4f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-05 19:55:38 +02:00
David Pursehouse 30c6c75421 Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8
Change-Id: I3b748620f067582afef20f144feebe40d0332be2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-04 10:53:10 +09:00
Terry Parker 00e51e35ee Return parsed objects from TestRepository.commit/tree/blob()
It is convenient for TestRepository to return fully parsed
objects from its commit()/tree()/blob() methods, so that test
code doesn't have to remember to parse them before making
assertions about them.

Update TestRepostiory to return fully parsed objects.
Adjust the tests that are affected by this change in behavior.

Change-Id: I09d03d0c80ad22cb7092f4a2eaed99d40a10af63
Signed-off-by: Terry Parker <tparker@google.com>
2018-06-28 16:28:09 -07:00
Matthias Sohn 2f1b4ffcd2 Prepare 5.1.0-SNAPSHOT builds
Change-Id: I8523a993ae1f7b62573d7547273bc1356bf64fa7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-23 10:18:18 +02:00
David Pursehouse 1f6d43a652 Fix trivial usages of deprecated Repository#getAllRefs
Callers of getAllRefs that only iterate over the `values()` of the
returned map can be trivially fixed to call getRefDatabase().getRefs()
instead.

Only fix those where the calling method is already declared to throw
IOException, to avoid potential API changes.

Change-Id: I2b05f785077a1713953cfd42df7bf915f889f90b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-23 13:31:22 +09:00
Han-Wen Nienhuys f3ec7cf3f0 Remove further unnecessary 'final' keywords
Remove it from

 * package private functions.

 * try blocks

 * for loops

this was done with the following python script:

$ cat f.py
import sys
import re
import os

def replaceFinal(m):
  return m.group(1) + "(" +  m.group(2).replace('final ', '') + ")"

methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)")

def subst(fn):
  input = open(fn)
  os.rename(fn, fn + "~")

  dest = open(fn, 'w')
  for l in input:
    l = methodDecl.sub(replaceFinal, l)
    dest.write(l)
  dest.close()


for root, dirs, files in os.walk(".", topdown=False):
  for f in files:
    if not f.endswith('.java'):
      continue

    full = os.path.join(root, f)
    print full
    subst(full)

Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2018-05-18 17:59:45 +02:00
Han-Wen Nienhuys 6d370d837c Remove 'final' in parameter lists
Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2018-05-15 17:05:02 -04:00
David Pursehouse 3d89622d4e Add API filter for "non-API type FileRepository" in tests
Change-Id: If805ad4a962e48dd16fbc7eff915fd6539839933
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-06 01:25:26 +02:00
David Pursehouse 5c70be0085 Open auto-closeable resources in try-with-resource
When an auto-closeable resources is not opened in try-with-resource,
the warning "should be managed by try-with-resource" is emitted by
Eclipse.

Fix the ones that can be silenced simply by moving the declaration of
the variable into a try-with-resource.

In cases where we explicitly call the close() method, for example in
tests where we are testing specific behavior caused by the close(),
suppress the warning.

Leave the ones that will require more significant refcactoring to fix.
They can be done in separate commits that can be reviewed and tested
in isolation.

Change-Id: I9682cd20fb15167d3c7f9027cecdc82bc50b83c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-13 22:16:06 +01:00
David Pursehouse f07b60239c Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8
Change-Id: I6714fc3666e1bced22abba94ceb700477349586e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-11 22:46:52 +01:00
Matthias Sohn d0f1f5eef6 Prepare 5.0.0-SNAPSHOT builds
Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-03-08 23:09:18 +01:00
Matthias Sohn f389e18a28 Prepare 4.11.1-SNAPSHOT builds
Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-03-08 21:10:08 +01:00
Matthias Sohn f944063517 JGit v4.11.0.201803080745-r
Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-03-08 13:43:46 +01:00
David Pursehouse f91ce7faad JGitTestUtil: Open auto-closeable resources in try-with-resource
Change-Id: Ibc8dd8509109708628e5189888fa528add486452
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-07 09:04:36 +09:00
David Pursehouse 0b4e781f7c Use StandardCharsets.UTF_8 in tests
Replace hard-coded "UTF-8" string with the constant.

Change-Id: Ie812add2df28e984090563ec7c6e2c0366616424
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-07 09:04:36 +09:00
David Pursehouse a573dfc658 Enable warning for resources not managed by try-with-resource
Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-03 23:58:47 +01:00
Thomas Wolf fc7d407d0b Honor CRLF settings when writing merge results
Merges are performed using the raw text as stored in the git
repository. When we write the merge result, we must apply the
correct CRLF settings. Otherwise the line endings in the result
will be wrong.

Bug: 499615
Change-Id: I37a9b987e9404c97645d2720cd1c7c04c076a96b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-02-02 00:45:32 +01:00
Matthias Sohn 5a4b6fd237 Prepare 4.11.0-SNAPSHOT builds
Change-Id: I5d5e2befcf530d93457d44684bd9e4fc2392e5eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-12-31 04:05:07 +01:00
Karsten Thoms 3832527b02 Add header Automatic-Module-Name for Java 9
Bug: 529075
Change-Id: I4532ce2c80eb91531d46026676502d636ccda706
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-12-23 01:00:01 +01:00
David Pursehouse 098893617d Repeat: Fix javadoc to say 'annotation' instead of 'interface'
Change-Id: Ib0c4ec28d6b7e2fc0fe71f7dc53dd12ccd6e8a2f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-12-18 10:21:37 +09:00
Matthias Sohn a90b75b47a Fix javadoc in org.eclipse.jgit.junit
Change-Id: I1107e6a82849ac329361baabb5c481d86ea6dc9e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-12-17 20:21:54 +01:00
David Pursehouse fdacfaecc4 Specify consistent version range for junit in OSGi manifests
There are several different version ranges specified in the various
manifest files.

Align them all to the same range:  [4.12,5.0.0)

Change-Id: I02205b8b8546c9f53ed431b5fd9abf6ddcda4423
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-12-08 17:00:56 +09:00
David Pursehouse 171f84a041 Use constants from StandardCharsets instead of hard-coded strings
Instead of hard-coding the charset strings "US-ASCII", "UTF-8", and
"ISO-8859-1", use the corresponding constants from StandardCharsets.

UnsupportedEncodingException is not thrown when the StandardCharset
constants are used, so remove the now redundant handling.

Because the encoding names are no longer hard-coded strings, also
remove redundant $NON-NLS warning suppressions.

Also replace existing usages of the constants with static imports.

Change-Id: I0a4510d3d992db5e277f009a41434276f95bda4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-12-07 20:02:59 +09:00
Matthias Sohn f0c119de4f Merge branch 'stable-4.9'
* stable-4.9:
  Ignore warning for minor version change without API change
  Silence boxing warning
  Prepare 4.5.5-SNAPSHOT builds
  JGit v4.5.4.201711221230-r
  Fix LockFile semantics when running on NFS
  Honor trustFolderStats also when reading packed-refs
  Prepare 4.5.4-SNAPSHOT builds
  JGit v4.5.3.201708160445-r

Change-Id: Icc33d2e36f140e8714fce088379673a8834ae9de
2017-11-24 01:18:13 +01:00
Matthias Sohn 03abd1dff2 Ignore warning for minor version change without API change
- this is a new warning option in Eclipse 4.7 and higher
- we always change version of all bundles in a release to keep release
engineering simple

Change-Id: Ic7523d77b67b2802f1bab3bc70af250d712a034f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-11-24 01:12:14 +01:00
Matthias Sohn 6858339c1e Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Silence boxing warning
  Prepare 4.5.5-SNAPSHOT builds
  JGit v4.5.4.201711221230-r
  Fix LockFile semantics when running on NFS
  Honor trustFolderStats also when reading packed-refs
  Prepare 4.5.4-SNAPSHOT builds
  JGit v4.5.3.201708160445-r

Change-Id: I7cf2e48934195430b3945b6d74b092f93a3ccd36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-11-24 01:08:23 +01:00
Minh Thai 15a189e4e0 Add flag for keeping ref tombstones in GC reftable
A tombstone will prevent a delayed reference update from resurrecting the
deleted reference.

Change-Id: Id9f4df43d435a299ff16cef614821439edef9b11
Signed-off-by: Minh Thai <mthai@google.com>
2017-11-15 22:48:04 -08:00
Hector Caballero 4334b27d3c ObjectDirectory: Add pack directory getter
So far, in order to get the pack directory it was necessary to resolve
it from the object directory. This resolution is already done when
creating the object directory, so simplify the call by just adding a
getter to the pack directory.

Change-Id: I69e783141dc6739024e8b3d5acc30843edd651a7
Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
2017-11-14 10:08:42 -05:00
Matthias Sohn 6b544da293 Prepare 4.10.0-SNAPSHOT builds
Change-Id: I5ca462d1db18a2c5c9382cfb9c83972510fa2b88
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-10-08 11:35:54 +02:00
Matthias Sohn 8180183289 Prepare 4.9.1-SNAPSHOT builds
Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-10-08 11:25:06 +02:00
Matthias Sohn 6877730fa0 JGit v4.9.0.201710071750-r
Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-10-07 23:46:52 +02:00
Matthias Sohn 41baa7a791 Partially revert c0ad77d8 "Enhance Eclipse save actions"
Do not automatically organize imports using a save action since this
seems to be buggy and removed some annotations org.eclipse.jgit.pgm
needs to use args4j.

Change-Id: I5a91292c3b9241ce2dde3e4ecce14ad460097129
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-30 03:07:18 +02:00
Matthias Sohn 9906f09868 Partially revert c0ad77d8 "Enhance Eclipse save actions"
Revert the following save actions which were introduced in c0ad77d8:
- always use braces around blocks
- remove unused imports

Other than I expected save actions are run globally on edited files -
and not only on edited code lines only.

Hence revert the save action "Convert control statement bodies to
blocks" which would affect a large number of code lines not affected by
the change editing some small part of a class. This would generate a
large number of changes which may lead to many unnecessary conflicts.
Total number of affected lines across jgit would be around 10k lines.

Also revert "Remove unused imports" since it erroneously removes imports
of some annotations needed by pgm classes using args4j.

Change-Id: I879a47f68e664129e6124cf25c1ae1f6a2d7a5aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-30 01:24:47 +02:00
Matthias Sohn c0ad77d84c Enhance Eclipse save actions
Add the following Eclipse save actions executed when saving modified
lines. This should help to reduce manual work needed to maintain a clean
and consistent code style:
- organize imports
- always use braces around blocks
- add missing annotations
  - @Override including implementation of interface methods
  - @Deprecated
- remove
  - unused imports
  - unnecessary $NON-NLS$ tags
  - redundant type arguments

Also add default values for new settings that were introduced in recent
Eclipse versions up to Neon since we updated save rules the last time.

Change-Id: Idc90b249df044d0552f04edf01a5f607c4846f50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-28 11:52:45 -04:00
Zhen Chen 2c2999643f Add dfs fsck implementation
JGit already had some fsck-like classes like ObjectChecker which can
check for an individual object.

The read-only FsckPackParser which will parse all objects within a pack
file and check it with ObjectChecker. It will also check the pack index
file against the object information from the pack parser.

Change-Id: Ifd8e0d28eb68ff0b8edd2b51b2fa3a50a544c855
Signed-off-by: Zhen Chen <czhen@google.com>
2017-07-26 10:12:29 -07:00
Dave Borowitz 65b64768b3 Move BatchRefUpdate tests to a new file
Run with @Parameterized, so we don't have to duplicate test setup for
each atomic/non-atomic test. We still have to have two different sets of
asserts for the cases where the behavior is different. In fact, this is
a readability win: it emphasizes that performing the exact same setup
except for the atomic setting will have different behavior.

Change-Id: I78a8214075e204732a423341f14c09de273a7854
2017-07-25 13:14:50 -04:00
David Pursehouse 4940ea14b7 Add missing newlines at ends of Java files
Change-Id: Iead36f53d57ead0eb3edd3f9efb63b6630c9c20c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-07-25 10:37:21 +01:00
Matthias Sohn 7922f31fa3 Prepare 4.8.1-SNAPSHOT builds
Change-Id: I7ca4186bbfe5ccc3fed4509a1fe4fc47bb2e8c50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-06-12 22:19:30 -04:00
Matthias Sohn 03b8d1a202 JGit v4.8.0.201706111038-r
Change-Id: Ie33623a2191ffffc2ca5756fd078a7003c0c660f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-06-11 16:39:41 +02:00
David Pursehouse a7949c1e35 Merge branch 'stable-4.8'
* stable-4.8:
  SubmoduleUpdateCommand#setCallback should return 'this'
  CloneCommand#setCallback should return 'this'
  Prepare 4.7.2-SNAPSHOT builds
  JGit v4.7.1.201706071930-r
  ArchiveCommand: Create prefix entry with commit time
  Run auto GC in the background
  Update Orbit to the Oxygen version R20170516192513

Change-Id: Ibf90b4899d097474e7836e6baab8829e66fca524
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-06-10 14:14:18 +09:00
Matthias Sohn 94c06009aa Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Run auto GC in the background

Change-Id: I5e25765f65d833f13cbe99696ef33055d7f5c4cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-06-07 16:58:18 +02:00
David Turner 6b1e3c58b1 Run auto GC in the background
When running an automatic GC on a FileRepository, when the caller
passes a NullProgressMonitor, run the GC in a background thread. Use a
thread pool of size 1 to limit the number of background threads spawned
for background gc in the same application. In the next minor release we
can make the thread pool configurable.

In some cases, the auto GC limit is lower than the true number of
unreachable loose objects, so auto GC will run after every (e.g) fetch
operation.  This leads to the appearance of poor fetch performance.
Since these GCs will never make progress (until either the objects
become referenced, or the two week timeout expires), blocking on them
simply reduces throughput.

In the event that an auto GC would make progress, it's still OK if it
runs in the background. The progress will still happen.

This matches the behavior of regular git.

Git (and now jgit) uses the lock file for gc.log to prevent simultaneous
runs of background gc. Further, it writes errors to gc.log, and won't
run background gc if that file is present and recent. If gc.log is too
old (according to the config gc.logexpiry), it will be ignored.

Change-Id: I3870cadb4a0a6763feff252e6eaef99f4aa8d0df
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-06-06 01:18:29 +02:00
Matthias Sohn df9ce4b981 Prepare 4.9.0-SNAPSHOT builds
Change-Id: I52a4153d573799e861ab104939f51fac1aceb9ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-05-30 13:42:07 +02:00
Matthias Sohn 3254672fcd Prepare 4.8.0-SNAPSHOT builds
Change-Id: I27fc4e4969fafde0fcba26aeebe30d732770b68f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-05-17 16:45:21 +02:00
Matthias Sohn b7d49e6d3c JGit v4.8.0.201705170830-rc1
Change-Id: I60c0a40f2e38748641b25a25bcf10346e2950886
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-05-17 14:26:54 +02:00
David Pursehouse c80d8c5901 Bazel: Restrict src globs to Java source files
Generating the src list with an unrestricted wildcard causes all
files in the source tree to be included. This results in junk files
such as .orig (generated during merge conflict resolution) to be
included, which causes in a build error:

  in srcs attribute of java_library rule //org.eclipse.jgit:jgit:
  file '//org.eclipse.jgit:src/org/eclipse/jgit/gitrepo/RepoCommand.java.orig'
  is misplaced here (expected .java, .srcjar or .properties).

Modify the globs to only include Java source files.

Change-Id: Iaef3db33ac71d71047cd28acb0378e15cb09ece9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-13 14:14:55 +09:00
Matthias Sohn 6a311a071f Prepare 4.7.1-SNAPSHOT
Change-Id: I16a45035258276217446bccc0ad1b0991383aa0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-06 00:16:53 +02:00
Matthias Sohn 9f4c10784b JGit v4.7.0.201704051617-r
Change-Id: Ic2bd6aca0b7a7e0597ffc1f7cf647b49878f9950
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 22:17:44 +02:00
Matthias Sohn aec22e74cf Prepare 4.8.0-SNAPSHOT builds
Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 14:49:49 +02:00
David Pursehouse 2d0ce094b4 Remove Buck build
Buck will be replaced with Bazel

Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-22 01:41:21 +01:00
Jonathan Nieder 02fe1e0b5b bazel: Mark junit targets testonly
Only testonly targets (such as tests) need to use junit.

In particular this involves making the toplevel :all rule testonly.
It's not clear to me what that rule is for --- "bazel build //..."
already works to build all targets.  In any case it appears to be for
testing, so marking it as testonly shouldn't be harmful.

Change-Id: I28ff508ab8ce2ec0a0111109110aa9680d30600e
2017-03-19 18:56:27 -07:00
Jonathan Nieder bc5014faec bazel: Add explicit targets for library dependencies
This provides a place to declare visibility restrictions and
transitive dependencies for each library.

Other targets should only declare dependencies on what they directly
use, making dependencies easier to maintain.

Trim the dependencies of org.eclipse.jgit:jgit to follow that rule.
It declares dependencies on Apache httpcomponents and the servlet
API but doesn't use them.

Tested:
* 'bazel build //...' succeeds
* applying the change https://gerrit-review.googlesource.com/90843
  to a copy of Gerrit, following the instructions there, and running
  'bazel test //...' in that copy of Gerrit still succeeds

Change-Id: I3ab958ce8b3227019cdbe4cc81e0f042e1541034
2017-03-19 18:51:03 -07:00
David Pursehouse 3b4448637f Enable and fix warnings about redundant specification of type arguments
Since the introduction of generic type parameter inference in Java 7,
it's not necessary to explicitly specify the type of generic parameters.

Enable the warning in Eclipse, and fix all occurrences.

Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-02-20 22:47:23 +01:00
David Pursehouse a46bc16a9f Add API filter for usage of FileRepository in test classes
FileRepository is in the package org.eclipse.jgit.internal, and is
thus non-API. This causes warnings in Eclipse when FileRepository is
used.

Add a filter to prevent the warnings.

Change-Id: I9a8ae106c085bb0e826031fa183b4c4bdabcc5fc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-02-20 22:43:06 +01:00
David Pursehouse 7ac182f4e4 Enable and fix 'Should be tagged with @Override' warning
Set missingOverrideAnnotation=warning in Eclipse compiler preferences
which enables the warning:

  The method <method> of type <type> should be tagged with @Override
  since it actually overrides a superclass method

Justification for this warning is described in:

  http://stackoverflow.com/a/94411/381622

Enabling this causes in excess of 1000 warnings across the entire
code-base. They are very easy to fix automatically with Eclipse's
"Quick Fix" tool.

Fix all of them except 2 which cause compilation failure when the
project is built with mvn; add TODO comments on those for further
investigation.

Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-02-19 20:05:08 -04:00
David Pursehouse a9a3ce92aa LocalDiskRepositoryTestCase: Add clarifying comment in call to createRepository
Clarify that 'true' means 'auto close'. This makes it consistent with
other calls that have a boolean argument for 'bare'. It also makes it a
bit easier to see what's going on while stepping in the debugger, because
it's not necessary to scroll around to find the method declaration.

Change-Id: Idacd749407dcfd258af3efaaf44d129069925dd3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-02-10 21:04:03 +09:00
Matthias Sohn 53ad437382 RepositoryCacheTest: avoid to close already closed repository
The tearDown() of the superclass closed the repository once more which
led to a negative use count warning logged by Repository.close().

Change-Id: I331f85a540c68264a53456276c32f72b79113d61
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-01-28 21:19:55 +01:00
David Pursehouse 5d0ca36d39 LocalDiskRepositoryTestCase: Only add to toClose through access method
Only using the access method means we only have one place where the
toClose set is modified, making it easier to debug either by adding
log statements or by setting a breakpoint.

Change-Id: I4f9f1774d5f2e10bcab381edfd84bb6ee0499a11
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-01-28 17:46:27 +01:00
David Pursehouse d69a829bdb LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close
Change the "toClose" list to a set, which will not allow duplicate
entries. This reduces the number of false positive logs about corrupt
use count due to the same repository being closed more than once during
teardown.

Change-Id: I5ab0ff8b56e7f2b2c7aab5274d957708d26f42c5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-01-27 16:00:06 +09:00
David Pursehouse dd5e500a57 Format Bazel files with buildifier
Change-Id: I934114315d2c7cab917f1011b8e55c52367d429f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-01-22 22:34:11 +01:00
David Ostrovsky e92a0c3adc Implement initial framework of Bazel build
The initial implementation only builds the packages consumed by
Gerrit Code Review.

Test build and execution is not implemented.

We prefer to consume maven_jar custom rule from bazlets repository,
for the same reasons as in the Gerrit project:

* Caching artifacts across different clones and projects
* Exposing source classifiers and neverlink artifact

TEST PLAN:

  $ bazel build :all
  $ unzip -t bazel-genfiles/all.zip
  Archive: bazel-genfiles/all.zip
    testing: libjgit-archive.jar      OK
    testing: libjgit-servlet.jar      OK
    testing: libjgit.jar              OK
    testing: libjunit.jar             OK
  No errors detected in compressed data of bazel-genfiles/all.zip.

Change-Id: Ia837ce95d9829fe2515f37b7a04a71a4598672a0
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-01-18 19:13:16 -04:00
Matthias Sohn 5fee071f6a Prepare 4.7.0-SNAPSHOT builds
Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-27 01:45:50 +01:00
Matthias Sohn 3857c3168f Prepare 4.6.1-SNAPSHOT builds
Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 15:51:54 +01:00
Matthias Sohn 73a4325149 JGit v4.6.0.201612231935-r
Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 01:42:38 +01:00
Shawn Pearce 81f9c18433 Define MonotonicClock interface for advanced timestamps
MonotonicClock can be implemented to provide more certainity about
time than the standard System.currentTimeMillis() can provide. This
can be used by classes such as PersonIdent and Ketch to rely on
more certainity about time moving in a strictly ascending order.

Gerrit Code Review can also leverage this interface through its
embedding of JGit and use MonotonicClock and ProposedTimestamp to
provide stronger assurance that NoteDb time is moving forward.

Change-Id: I1a3cbd49a39b150a0d49b36d572da113ca83a786
2016-11-21 11:34:14 -08:00
Shawn Pearce 8208da2f59 Deprecate SafeBufferedOutputStream
Java 8 fixed the silent flush during close issue by
FilterOutputStream (base class of BufferedOutputStream)
using try-with-resources to close the stream, getting a
behavior matching what JGit's SafeBufferedOutputStream
was doing:

  try {
    flush();
  } finally {
    out.close();
  }

With Java 8 as the minimum required version to run JGit
it is no longer necessary to override close() or have
this class. Deprecate the class, and use the JRE's version
of close.

Change-Id: Ic0584c140010278dbe4062df2e71be5df9a797b3
2016-11-14 15:33:54 -08:00
David Pursehouse a45cfee7a3 Organize imports
Change-Id: I7c545d06b1bced678c020fab9af1382bc4416b6e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2016-11-14 13:25:20 -08:00
Matthias Sohn ab79ce91c1 Change JGit minimum execution environment to JavaSE-1.8
Bug: 500059
Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-09-20 11:32:36 +02:00
Matthias Sohn 9d4ffcc1ab Prepare 4.6.0-SNAPSHOT builds
Change-Id: Id2eafc331ee32c332c2a9b867b05c260beb0d10f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-09-19 17:06:42 +02:00
Matthias Sohn 2d4d64481b Add a RepeatRule to help repeating flaky tests
A JUnit TestRule which enables to run the same JUnit test repeatedly.
This may help to identify the root cause why a flaky tests which succeed
most often does fail sometimes.

Add the RepeatRule to the test class containing the test to be repeated:

public class MyTest {
	@Rule
	public RepeatRule repeatRule = new RepeatRule();
	...
}
 
and annotate the test to be repeated with the @Repeat(n=<repetitions>)
annotation:
 
	@Test
	@Repeat(n = 100)
	public void test() {
		...
	}
 
then this test will be repeated 100 times. If any test execution fails
test repetition will be stopped.

Change-Id: I7c49ccebe1cb00bcde6b002b522d95c13fd3a35e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-08-25 17:36:32 -04:00
David Pursehouse 4528d5f56d Ignore 'The value of exception parameter is not used' warning
Change-Id: I50407e4a33e35b718ca40503fdd436f1f9f70fba
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2016-07-26 10:16:49 +09:00
Matthias Sohn 75b3301939 Prepare 4.5.0-SNAPSHOT builds
Change-Id: I572fe9fea0e5ca0bec4648c916ae95a5b1ccf125
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 23:04:07 +02:00
Terry Parker bd63a56da2 Remove the deprecated TestRepository.getClock() method
Gitles was the holdout and TestRepository.getClock() was removed via:
https://gerrit.googlesource.com/gitiles/+/f10481d8384d1695e6981b805c4e5e462e4b71ea

Change-Id: I90c0fc17be4891545b097a49763b0f0c202cc004
Signed-off-by: Terry Parker <tparker@google.com>
2016-05-31 10:16:53 -07:00
Matthias Sohn 4c236ff4bb Replace use of deprecated method Repository.getRef()
Change-Id: Iecf2b8deafc4991cc3333702fb9fa0638be7b914
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-31 00:11:11 +02:00
Matthias Sohn 0c72f60fbf Fix type parameter in javadoc in TestRepository.delete(String ref)
Type parameter T extends AnyObjectId in signature of update(String, T)

Change-Id: I9c13ddc572b8e94d5c7854f4de1f8206cb5e99ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-05 22:51:14 +02:00
Jonathan Nieder bc9df9c63c TestRepository: Add delete() method
Change-Id: Ib4841397ceab44bd38cf2f154314ac36ded73ae0
2016-05-04 15:48:36 -07:00
Matthias Sohn ccf8363693 Prepare 4.4.0-SNAPSHOT builds
Change-Id: If3162f4cc4ae6319b9f1e3293549485b039cfe7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-08 17:59:59 +02:00
Matthias Sohn f2ee537d55 Prepare 4.3.1-SNAPSHOT versions
Change-Id: I52c98ba8fb3a303269a1f9380af114b6dd8c5009
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-08 00:56:43 +02:00
Matthias Sohn 4f0daa3bb2 JGit v4.3.0.201604071810-r
Change-Id: I902cdf1ff92ce8c6e9d80c4965d8d5bd8b9ac6c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-08 00:10:10 +02:00
Matthias Sohn 57e6274bcf JGit v4.3.0.201604071045-r
Change-Id: Iafab78d6be34d31a13f979b7be67611135c0f8bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-07 16:41:24 +02:00
Terry Parker 10135580d0 In TestRepository, use a consistent clock
The default author and committer objects in TestRepository were
initialized statically and did not use the MockSystemReader passed into
the TestRepository ctor. Make these fields non-static and initialize
them with a consistent clock.

Also make the author and commiter name and email strings public for
tests that want to verify against them.

Change-Id: I88b444b96e22743001b32824d8e4e03c2239aa86
Signed-off-by: Terry Parker <tparker@google.com>
2016-03-25 14:03:40 -07:00
XinTong Wang 770d36c8ba Fix apply patch which did not work with non-ascii characters
Bug: 483943
Change-Id: If28f64053d20ab1bee54245f223e952dc2fe392c
Signed-off-by: XinTong Wang <xintong@ca.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-03-03 01:43:02 +01:00
Matthias Sohn 514b11ddcc Merge branch 'stable-4.2'
* stable-4.2:
  Don't use deprecated LockFile constructor
  Fix warnings about unchecked conversion of MergeResult
  MockServletConfig: Fix warning about unchecked conversion of Enumeration
  HugeFileTest: Make Git a class member and open in try-with-resource
  Suppress "unchecked cast" warnings related to UploadPackFactory.DISABLED
  DiffAlgorithms: Fix warnings about variable hiding
  DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource
  DirCacheBuilderIteratorTest: Open TreeWalk in try-with-resource
  DirCacheCGitCompatabilityTest: Open TreeWalk in try-with-resource
  DirCacheCheckoutMaliciousPathTest: Open Git and RevWalk in t-w-r
  DirCacheIteratorTest: Open TreeWalk instances in try-with-resource
  ForPathTest: Open TreeWalk in try-with-resource
  GitConstructionTest: Open Git instance in try-with-resource
  IndexDiffTest: Open Git instances in try-with-resources
  ManifestParserTest: Don't use deprecated StringBufferInputStream
  InMemoryRepository: Remove unused RevWalk from batch method signature
  IndexModificationTimesTest: Open Git instances in try-with-resource
  InterIndexDiffFilterTest: Open TreeWalk in try-with-resource
  LockFileTest: Open Git instance in try-with-resource
  JGit v4.1.2.201602141800-r
  MergeCommandTest: Use JUnit's assume to check preconditions
  MergeCommandTest: Open Git instances in try-with-resource

Change-Id: Ie5dba6b9132a29e86958a04fa2b76465bcd2c6b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-15 23:28:18 +01:00
David Pursehouse e96cb22a43 Don't use deprecated LockFile constructor
Change-Id: Ibc3e2f3372e1a65732dd6d3c71cec53fb1aa15e2
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-15 18:44:24 +09:00
Matthias Sohn 28e2fed761 Merge branch 'stable-4.2'
* stable-4.2:
  RepoProject: Fix warnings about variable hiding
  RepoTest: Open Git in try-with-resources
  RepositoryResolveTest: Open Git in try-with-resource
  RepositoryTestCase: Open autocloseable types in try-with-resource
  ResetCommandTest: Use Git member in testHardResetAfterSquashMerge
  ResolveMergerTest: Open Git in try-with-resource
  RevCommitListTest: Open Git and RevWalk in try-with-resource
  RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource
  RevObjectTest: Open RevWalk in try-with-resource
  RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource
  RevertCommandTest: Open Git in try-with-resource
  SquashMessageFormatterTest: Open git in try-with-resource
  StatusCommandTest: Open Git in try-with-resource
  SubmoduleAddTest: Open Git in try-with-resource
  SymlinksTest: Open git and TreeWalk in try-with-resource
  T0003_BasicTest: Open autocloseable types in try-with-resource
  TextHashFunctions: Fix warnings about variable hiding
  TreeFilterTest: Open TreeWalk in try-with-resource
  TreeWalkJava7Test: Open TreeWalk in try-with-resource
  Fix diff for added and removed submodule

Change-Id: If3ecc63f6dfac55474d3c1dd2f4105371f3d24fb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-10 00:51:01 +01:00
David Pursehouse b85e93046c RepositoryTestCase: Open autocloseable types in try-with-resource
ObjectInserter.Formatter and Git are autocloseable and can be
opened in try-with-resource to prevent a resource leak warning.

Change-Id: I48c4001aaa7d9c1e36369e9799bfbb7c3bb46d8b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 18:12:05 +09:00
Matthias Sohn fc4d117511 Prepare 4.2.1-SNAPSHOT builds
Change-Id: Ic9eac53b10ac97b2038b334d388ae3d21393f993
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:48:52 +01:00
Matthias Sohn 20c2079f70 JGit v4.2.0.201601211800-r
Change-Id: I89f33b0da81ff499315baa5311f95f31724fa510
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 23:47:12 +01:00
Matthias Sohn b30917ce21 Prepare 4.3.0-SNAPSHOT builds
Change-Id: Idcf0479529693b023042becd96698f9afd344bd4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 21:49:41 +01:00
Matthias Sohn 3af05f6080 Remove declared IOException which is no longer thrown
Since 2ccea7f0 ChangeIdUtil.computeChangeId() doesn't throw IOException
anymore.

Change-Id: I0bf43f2346dadbbfe7e6cbcb38b5525456fbf686
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-20 01:55:51 +01:00
Shawn Pearce 4e650c0d76 PackWriter: Declare preparePack object sets as @NonNull
Require callers to pass in valid sets for both want and have
collections. Offer PackWriter.NONE as a handy constant for an
empty collection for the have part of preparePack instead of null.

Change-Id: Ifda4450f5e488cbfefd728382b7d30797e229217
2016-01-12 19:30:32 -05:00
Matthias Sohn 91a3f17474 Merge changes Idaed9310,I62bd7c0b
* changes:
  ObjectChecker: honor some git-core fsck.* options
  ObjectChecker: allow some objects to skip errors
2016-01-03 10:27:37 -05:00
David Ostrovsky 13502fef8f Implement Buck driven build
Today there are plenty of modern build tool systems available in the
wild (in no particular order):

* http://bazel.io
* https://pantsbuild.github.io
* http://shakebuild.com
* https://ninja-build.org
* https://buckbuild.com

The attributes, that all these build tools have in common, are:

* reliable
* correct
* very fast
* reproducible

It must not always be the other build tool, this project is currently
using. Or, quoting Gerrit Code Review maintainer here:

  "Friends, don't let friends use <the other build tool system>!"

This change is non-complete implementation of JGit build in Buck,
needed by Gerrit Code Review to replace its dependency with standlone
JGit cell. This is very useful when a developer is working on both
projects and is trying to integrate changes made in JGit in Gerrit.

The supported workflow is:

  $ cd jgit
  $ emacs <hack>
  $ cd ../gerrit
  $ buck build --config repositories.jgit=../jgit gerrit

With --config repositories.jgit=../jgit jgit cell is routed through
JGit development tree.

To build jgit, issue:

  $ buck build //:jgit
  [-] PROCESSING BUCK FILES...FINISHED 0,0s

Yes, you can't measure no-op build time, given that Buck daemon is
used.

Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2015-12-31 10:08:55 -08:00
Shawn Pearce fa7ce0e0f3 ObjectChecker: allow some objects to skip errors
Some ancient objects may be broken, but in a relatively harmless way.
Allow the ObjectChecker caller to whitelist specific objects that are
going to fail checks, but that have been reviewed by a human and decided
the objects are OK enough to permit continued use of.

This avoids needing to rewrite history to scrub the broken objects out.

Honor the git-core fsck.skipList configuration setting when receiving a
push or fetching from a remote repository.

Change-Id: I62bd7c0b0848981f73dd7c752860fd02794233a6
2015-12-30 15:18:48 -08:00
Christian Halstrick 5d9f595eb8 Add support for clean filters
When filters are defined for certain paths in gitattributes make
sure that clean filters are processed when adding new content to the
object database.

Change-Id: Iffd72914cec5b434ba4d0de232e285b7492db868
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-11-27 23:23:09 +01:00
Matthias Sohn 2cdc130dfc Add missing @since tags and missing javadoc
Change-Id: I8575797127fc96abea8af56f019ca39f5897486f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-11-25 19:25:53 -05:00
Terry Parker 2c70d183f5 Restore TestRepository.getClock(), it is used by Gerrit/Gitiles
Change-Id: I88880f18998e33377c0c684cbd8007b5d27d76e7
Signed-off-by: Terry Parker <tparker@google.com>
2015-10-22 15:29:11 -07:00
Terry Parker 069040ddad Push control of time into MockSystemReader
LocalDiskRepositoryTestCase and TestRepository have competing ideas
about time. Push them into MockSystemReader so they can
cooperate.

Rename getClock() methods that return Dates to getDate().

Change-Id: Ibbd9fe7f85d0064b0a19e3b675b9718a9e67c479
Signed-off-by: Terry Parker <tparker@google.com>
2015-10-20 15:57:31 -07:00
Andrey Loskutov a406ebf401 Delete non empty directories before checkout a path
If the checkout path is currently a non-empty directory (and was a link
or a regular file before), this directory will be removed before
performing checkout, but only if the checkout path is specified.

Bug: 474973
Change-Id: Ifc6c61592d9b54d26c66367163acdebea369145c
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-10-09 09:23:30 -04:00
Matthias Sohn 6664bc6f1c Prepare 4.2.0-SNAPSHOT builds
Change-Id: If559d3565b1f84c93a533e1ce18d5293605d1950
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 14:48:41 +02:00
Matthias Sohn 729f085ac2 Prepare 4.1.1-SNAPSHOT builds
Change-Id: I035f3a8d0f0de86e8b8f00e668be5ce008402e82
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 13:37:39 +02:00
Matthias Sohn fdfd6e2872 JGit v4.1.0.201509280440-r
Change-Id: I9a536870b9f5c1247c52d6c976a954115982fa1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 10:36:08 +02:00
Andrey Loskutov 41a972cd1e [performance] Cache platform name in SystemReader
SystemReader.isMacOs() and SystemReader.isWindows() return values are
unlikely to change during the JVM lifetime (except tests). Don't read
system properties each time the methods are called, just use previously
calculated value.

Change-Id: I495521f67a8b544e7b7247d99bbd05a42ea16d20
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-09-27 02:04:57 +02:00
Matthias Sohn 4a11534c25 Restore lazy Bundle-ActivationPolicy removed in 3a4a5a4e
This header was removed unintentionally from some bundles in
3a4a5a4e57. Restore it to ensure lazy
activation of bundles.

Change-Id: I1f841f978fb93278e3ec0533a01f1363510dd976
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-08-31 22:18:54 +02:00
Matthias Sohn 3a4a5a4e57 Update uses-clauses in OSGi manifests
In Bug 476164 it was reported that EGit doesn't start when the platform
comes with jsch 0.1.51 while this version of EGit/JGit brings jsch
0.1.53. This could be caused by outdated uses-clauses. Hence recompute
them using PDE tooling.

Bug: 476164
Change-Id: I185ba097884ead9cd034eba842bd3bf34181a99b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-08-31 11:34:06 +02:00
Chris Price 37a1e4beaa Move `RepositoryTestCase.indexState` to parent class
The test helper method `indexState` in `RepositoryTestCase` is
very useful for writing tests, even in cases where we need to
do things like create more than one repository for a test and
thus we don't want to use the built-in `db` member variable that
exists in `RepositoryTestCase`.  Since the method is static,
we can move it up to the parent class `LocalDiskRepositoryTestCase`,
where it can be used by tests that aren't a great fit for inheriting
directly from `RepositoryTestCase`.

Bug: 436200
Change-Id: I2b6de75c001d2d77ddb607488af246548784a67f
Signed-off-by: Chris Price <chris@puppetlabs.com>
2015-07-10 00:56:58 +02:00
Chris Price ad16eaac6e Change `indexState` to static method
The `indexState` method is no longer referring to any
member variables from the class, so it can be made static.

Bug: 436200
Change-Id: I013316de5c373417ea758ca6e17da29209fead53
Signed-off-by: Chris Price <chris@puppetlabs.com>
2015-07-10 00:56:58 +02:00
Chris Price 88168c6d60 Use local variable in RepositoryTestCase.indexState
There is a signature of the test helper method `indexState`,
in `RepositoryTestCase`, that accepts a `Repository` object
as an argument.  However, there was one line of code where
this variable was not being used, and the method was instead
referring to a member variable `db`.  I believe this was
probably just an oversight in a previous refactor, and
that the correct behavior is to use the variable from
the argument list.  This change also has the benefit
of making it possible to convert this method to a static
method, since it no longer relies on any state from the class.

Bug: 436200
Change-Id: Iac95b046dc5bd0b3756642e241c3637f1fad3609
Signed-off-by: Chris Price <chris@puppetlabs.com>
2015-07-07 12:34:03 +01:00
Matthias Sohn a79168bcbb Prepare 4.1.0-SNAPSHOT builds
Change-Id: I03d08b8e2d3400d4b5cdb4ab541b312870776843
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-06-03 00:52:00 +02:00
Matthias Sohn 686124bec3 Replace deprecated release() methods by close()
See the discussion [1] in the Gerrit mailing list.

[1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o

Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-05-21 02:05:45 +02:00
Dave Borowitz f1a15f7eb0 TestRepository: Add a cherryPick method
CherryPickCommand only works on a non-bare repository, as it must
modify the working tree and index in case of a merge conflict. In
tests, being able to recover from a merge conflict is less important,
as the caller should be able to control the full contents of files in
advance of the cherry-pick.

Change-Id: Ic332e44df1308b9336e884666b08c1f6db64513d
2015-03-23 13:03:31 -07:00
Dave Borowitz be08dcb6b5 TestRepository: Expose a Git instance
Change-Id: I2fab7dd9a24205686db4724e77c0fd0a28f2075e
2015-03-18 06:59:55 -07:00
Dave Borowitz 8b6f9ace15 TestRepository: Allow setting explicit Change-Id
This includes both leaving existing Change-Ids alone (as, for example
Gerrit's commit-msg hook does) and programmatically setting a value.

Change-Id: Iaaffb0107ae27de24df1f0e95a8d628fb8ea5364
2015-03-12 12:47:18 -07:00
Dave Borowitz 6ed07f5cb5 TestRepository: Ignore existing Change-Id in message
Change-Id: I343c3065fa369ef8aab2b033ac1e392b28d10daf
2015-03-12 12:46:50 -07:00
Dave Borowitz 0b625445ef TestRepository: Support committing to unborn symref
Change-Id: I6bcee635adda7c929f6fa68ef20438fe77e49184
2015-03-12 12:46:26 -07:00
Dave Borowitz 828721826a TestRepository: Expose some getters for CommitBuilder
Change-Id: Ic6d179bd2de0081633c22fb82ca68ea619cb686f
2015-03-12 12:46:26 -07:00
Dave Borowitz da85ca73ff TestRepository: Add methods to amend commits or refs
Change-Id: I47082416f6e281262b160ba15272258f9109abd1
2015-03-12 12:46:24 -07:00
Dave Borowitz d79cadb3cf TestRepository: Add a reset method to move HEAD around
This flushed out a number of bugs in the way DfsRefUpdate, or at least
the InMemoryRepository implementation, processes symrefs. These have
been fixed, to an extent, in InMemoryRepository, but other
implementations may still suffer from these bugs.

Change-Id: Ifd12115a0060b9ff45a88d305b72f91ca0472f9a
2015-03-12 12:45:46 -07:00
Dave Borowitz c1d40caa32 TestRepository: Optionally insert Change-Id in commit message
Copied the implementation from CommitCommand.

Change-Id: Iade0e2d70bde70cfa830fe23bcc41959b011a14a
2015-03-12 10:47:12 -07:00
Dave Borowitz 3d5e70bc5a TestRepository: Allow custom author/committer per-commit
Change-Id: I078fe00470ebe60f93f4a718c163dd1412fdc776
2015-03-11 11:41:02 -07:00
Dave Borowitz 6599111d92 TestRepository: Use try-with-resources where appropriate
Change-Id: I06f9534ab84278df37a140700fc2bed5ab667299
2015-03-11 11:41:00 -07:00
Matthias Sohn c26bc63ef1 Set minimum required Java version to Java 7
Bug: 458475
Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-09 14:11:50 +01:00
Matthias Sohn 94ebdbfada Prepare 4.0.0-SNAPSHOT builds
Change-Id: I414ba8ccc82866d3107ba7083a567ea70c879bdf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-01-27 08:48:26 +01:00
Matthias Sohn cdfd22da30 Prepare 3.7.0-SNAPSHOT builds
Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-24 01:17:40 +01:00
Matthias Sohn 02b0660b8b Prepare 3.6.1-SNAPSHOT builds
Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-23 23:38:20 +01:00
Matthias Sohn b2ca2ffd7d JGit v3.6.0.201412230720-r
Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-23 13:56:43 +01:00
Christian Halstrick 3226e35db8 Fix junit tests under windows when the platform is explicitly changed
SystemReader used a chached ObjectChecker which was instantiated only
once. But in case of unit tests where we can change the platform
dynamically (e.g. MockSystemReader.setWindows()) this is wrong and
caused DirCacheCheckoutMaliciousPathTest.
testMaliciousAbsoluteCurDrivePathWindowsOnUnix() to fail. This change
allows 
user of SystemReader to force the creation of a new ObjectChecker. 
MockSystemReader.setWindows() and .setUnix() make use of this feature.

Change-Id: I87458d1dc63c1f5c18979f972b1c1f0d670a9ed8
2014-12-22 15:19:09 +01:00
Christian Halstrick 03e860a7b7 Allow explicit configuration of git directory in InitCommand
Native git's "init" command allows to specify the location of the .git
folder with the option "--separate-git-dir". This allows for example to
setup repositories with a non-standard layout. E.g. .git folder under
/repos/a.git and the worktree under /home/git/a. Both directories
contain pointers to the other side: /repos/a.git/config contains
core.worktree=/home/git/a . And /home/git/a/.git is a file containing
"gitdir: /repos/a.git". This commit adds that option to InitCommand.
This feature is needed to support the new submodule layout where the
.git folder of the submodules is under .git/modules/<submodule>.

Change-Id: I0208f643808bf8f28e2c979d6e33662607775f1f
2014-12-15 00:22:50 +01:00
Christian Halstrick 35c00a7a73 Fix LocalDiskRepositoryTestCase to create correct type of repos
In one place LocalDiskRepositoryTestCase was ignoring the specification
whether to create a bare or non-bare repository. Fix this and fix also
one test which fails now because bare repos don't write reflogs by
default.

Change-Id: I4bcf8cf97c5b46e2f3919809eaa121a8d0e47010
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-12 13:34:43 +01:00
Matthias Sohn 5672535360 Prepare post 3.6.0-m1 builds
Change-Id: Ie9927de64fa6b7d517f96b8cd12e57541f284ff2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-11-12 18:51:54 +01:00
Matthias Sohn 1555eeaa9c JGit v3.6.0.201411121045-m1
Change-Id: I9d789113d88cbbbdbabb8919f80c805aa4ba86fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-11-12 16:41:54 +01:00
Matthias Sohn 6ccf609e89 Prepare 3.6.0-SNAPSHOT builds
Change-Id: I2d8c3768998c0cfc8d02d11009bc5b7ed1d75778
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-05 14:32:01 +02:00
Christian Halstrick 0c4553d28a Fix RecursiveMerger's internal use of merge to find a merge base
When RecursiveMerger tried to determine a common base tree it was
recursively tried to merge multiple common bases. But these intermediate
merges which have just been done to determine a single common base for
the final merge already filled some important fields (toBeCheckedOut,
toBeDeleted, ...). These side effects of the intermediate merges led to
wrong results of the final merge. One symptom was that after a recursive
merge which should be succesful you could still see leftover files in
the worktree: files which existed in the (virtual) common base but which
don't exist anymore in the branches to be merged.

The solution is easy: Clear the appropriate fields after common base
determination and start the final merge with a clean state.

Change-Id: I644ea9e1cb15360f7901bc0483cdb9286308c226
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2014-07-25 03:32:38 -04:00
Robin Rosenberg a03bdcbbb4 Don't warn for methods that can be static
Making the methods static would gain little in performance,
make the code harder to change. Removing unncessary warnings
is more important.

Change-Id: If3e6aa9c1d92e58b4e7a8e246cf4aace237d7a7b
2014-07-02 00:36:38 +02:00
Robin Rosenberg 8032b64980 Add new default settings from Eclipse 4.4
These settings were added by Eclipse simply by touching
the project settings. Adding these makes it simpler to see
what local changes have been made.

Change-Id: Iab0aa62530312eb0c78b03b5c6a632742bcc4978
2014-07-02 00:34:41 +02:00
Robin Rosenberg 0f14d3bf40 Try to fix intermittent test failure related to file timestamps
Improve how tests do a "touch" operation on files. Instead of doing
"f.setLastModified(System.currentTimeMillis)" open a Outputstream on the
file and directly close it again. This makes this method rely only on
one clock - the clock of the filesystem.

Bug: 436917
Change-Id: I68ef3c2878f28b12daebf2ef6a9fa0a5d6e0964d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-07-01 15:29:11 +02:00
Robin Rosenberg 64b0531c35 Prepare 3.5.0-SNAPSHOT builds
Change-Id: I53bd500188e09ae2e007a58b3cd89aa0805d6f2a
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2014-06-04 18:23:29 -04:00
Matthias Sohn 0e13adb9cf Prepare post 3.4.0 RC1 builds
Change-Id: Ia8d29046439bc9134acdf7c88ab85ea49c4ddf47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-21 22:04:43 +02:00
Matthias Sohn d2d56e9efb JGit v3.4.0.201405211411-rc1
Change-Id: Ia3834770b9719f64cbdfd0338034c392fa3ae5db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-21 20:11:56 +02:00
Matthias Sohn 3a47e45c32 Prepare 3.4.0-SNAPSHOT builds
Change-Id: I5cf20c875c3e92e12c2b22465774ba42513b9add
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-06 00:04:09 +02:00
Matthias Sohn f6c42684d9 JGit v3.4.0.201405051725-m7
Change-Id: I8d941d22becdf019199a1c0fe28aa5835038647d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-05 23:33:03 +02:00
Matthias Sohn 47207e98d4 Prepare 3.4.0-SNAPSHOT builds
Change-Id: I907c6f1834c06b8ab4d3e0f76dde475faea7b4a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 02:20:38 +01:00
Matthias Sohn c1fee1d16b Prepare 3.3.1-SNAPSHOT builds
Change-Id: If15560f2731e54dbf9db88d8a308b4c25ce27e8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 00:34:15 +01:00
Matthias Sohn 3d855dbfc6 JGit v3.3.0.201403021825-r
Change-Id: Iaf3da455f7d6f691617299e881154ff8185a9d46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-03 00:26:54 +01:00
Matthias Sohn 3cebf9c466 Prepare post 3.3.0RC1 builds
Change-Id: I0d808f8733a490b75bbcaacedb4b095e05fab32e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-20 01:04:07 +01:00
Matthias Sohn 8bf45c23df JGit v3.3.0.201402191814-rc1
Change-Id: Ida3a0417ae646ce37214153f49a85de2be3dd4fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-20 00:14:45 +01:00
Matthias Sohn b14a939718 Prepare 3.3.0-SNAPSHOT builds
Change-Id: I7c7e7c1beec0c5d15b96c14c73ce93e3f09855c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-12-05 22:42:47 +01:00
Shawn Pearce d54d19740a Move SampleDataRepositoryTestCase to org.eclipse.jgit.test
This class requires resources which are private to another
bundle. Move the class next to its resources, removing an
odd cross bundle dependency.

Change-Id: I30d5568b09ea5fb3bd3bb60b602f149c0867f49a
2013-11-24 05:27:14 -05:00
Shawn Pearce 573d36a464 Support running from JARs in JGitTestUtil
Buck invokes JUnit tests from compiled JARs, not class directories.
When copying a resource back to the filesystem a jar: style URL is
obtained from the ClassLoader.

Change-Id: I28d702484ec13b0b309b87990da867050e4b5ec6
2013-11-24 05:27:00 -05:00
Matthias Sohn e649287502 Enhance RepositoryTestCase.commitFile() to work on empty repository
Change-Id: Ic64497f0eedf8996ba593ca52dc9a040732a5b24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-31 08:28:46 -04:00
Robin Stocker 09711a4bb9 Make sure SystemReader is reset after test is run
Otherwise the MockSystemReader from the test setup is active for other
tests.

Change-Id: I7caf693bd692d06936e29efd4dc4aabb48c1c39b
Signed-off-by: Robin Stocker <robin@nibor.org>
2013-10-22 00:37:56 +02:00
Robin Rosenberg 068e2df1ce Fix failed tests when the tmp directory is a symlink
On Mac OS X /tmp is by default a symbolic link.

Change-Id: I0913ee5ee8db5c5918a9e41abbbfe125b6c70783
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-20 00:13:58 +02:00
Matthias Sohn 7995d87713 Prepare 3.2.0-SNAPSHOT builds
Change-Id: Iac6cf7a5bb6146ee3fe38abe8020fc3fc4217584
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 18:21:31 +02:00
Matthias Sohn da6e87bc37 Prepare post 3.1.0 builds
Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 17:29:00 +02:00
Matthias Sohn 16ca725b35 JGit v3.1.0.201310021548-r
Change-Id: I2170b13047d5eab7565f47f9feb1680e03b1ba09
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-02 22:09:19 +02:00
Matthias Sohn 5a2a2222ef Prepare post 3.1.0 RC1 builds
Change-Id: I060f2082ccd0c91905b6b29a49cc633a0b51a1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 15:54:40 +02:00
Matthias Sohn 6f0681eb9f JGit v3.1.0.201309270735-rc1
Change-Id: I48202dd461110da25f9bc159c938311fff0669e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 13:34:51 +02:00