Commit Graph

2034 Commits

Author SHA1 Message Date
Matthias Sohn e51d2fcda8 JGit v4.11.1.201807311124-r
Change-Id: Ic58a916d7e2c380b84690afa5e3517c6c178af8c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 17:31:30 +02:00
Matthias Sohn fd4a62fdf0 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I2b44d862869d4453c57db668fc7c925da591f671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 13:38:21 +02:00
Matthias Sohn 8b97c266c3 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Ie7029bc91621af32e7bfd2e0d76a424b991b1995
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 11:03:24 +02:00
Matthias Sohn a0b818ce01 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I6ab2b951dd94a9fc1c4f5283847a3e2ec37d0895
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 10:52:13 +02:00
David Pursehouse e90a013e45 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Iadc8275fbaa3d6f7d08a96ab66d49f392f6aab78
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-07-27 08:22:51 +01:00
Matthias Sohn 29118ed117 Prepare 4.7.3-SNAPSHOT builds
Change-Id: I5c437f45d5bc469e3c32bef1180c127d96d24d23
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 01:00:35 +02:00
Matthias Sohn 01787756aa JGit v4.7.2.201807261330-r
Change-Id: I0d8c7ca756e6236e315c91da000fe8103ce83d05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-26 19:28:38 +02:00
Luca Milanesio 977726e5bb Delete all loose refs empty directories
Remove completely the empty directories under refs/<namespace>
including the first level partition of the changes, when they are
completely empty.

Bug: 536777
Change-Id: I88304d34cc42435919c2d1480258684d993dfdca
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-26 01:13:56 +02:00
Hector Caballero 4eea4ea508 GC: Remove empty references folders
After packaging references, the folders containing these references are
not deleted. In a busy repository, this causes operations to slow down
as traversing the references tree becomes longer.

Delete empty reference folders after the loose references have been
packed.
To avoid deleting a folder that was just created by another concurrent
operation, only delete folders that were not modified in the last 30
seconds.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: Ie79447d6121271cf5e25171be377ea396c7028e0
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-07-10 20:24:59 +09:00
David Pursehouse f5b25bcad3 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I016c9b3ec0081542bb903f361d9a3af1ea746ae3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:07:55 +09:00
David Pursehouse bb5dab9613 Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: Idc653c22a9af2013a4c481bb19ca8d059f5c34d0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:06:54 +09:00
David Pursehouse 0f7f3b62ce Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I2a0e0b63a06f442f5a088d4bc8bb08eaf02ce952
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-19 21:41:13 +09:00
Dave Borowitz 8223a7e646 Temporarily @Ignore flaky CommitCommandTest methods
Change-Id: Ia2c42d014323bd29b85bf76f1a20c83f612406d7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit e93b0026ce)
2018-06-19 20:52:23 +09:00
David Pursehouse 61e4f16652 ObjectIdSerializer: Support serialization of known non-null ObjectId
The implementation of ObjectIdSerializer, added in change I7599cf8bd,
is not equivalent to the original implementation in Gerrit [1].

The Gerrit implementation provides separate methods to (de)serialize
instances of ObjectId that are known to be non-null. In these methods,
no "marker" is written to the stream. Replacing Gerrit's implementation
with ObjectIdSerializer [2] broke persistent caches because it started
writing markers where they were not expected [3].

Since ObjectIdSerializer is included in JGit 4.11 we can't change the
existing #write and #read methods. Keep those as-is, but extend the
Javadoc to clarify that they support possibly null ObjectId instances.

Add new methods #writeWithoutMarker and #readWithoutMarker to support
the cases where the ObjectId is known to be non-null and the marker
should not be written to the serialization stream.

Also:

- Replace the hard-coded `0` and `1` markers with constants that can
  be linked from the Javadocs.

- Include the marker value in the "Invalid flag before ObjectId"
  exception message.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/9792
[2] https://gerrit-review.googlesource.com/c/gerrit/+/165851
[3] https://gerrit-review.googlesource.com/c/gerrit/+/165952

Change-Id: Iaf84c3ec32ecf83efffb306fdb4940cc85740f3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-15 09:39:43 +09: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
Thomas Wolf 7d3040368f Fix DiffFormatter for diffs against working tree with autocrlf=true
The WorkingTreeSource produced an ObjectLoader that returned
inconsistent sizes: the file size in getSize(), but then a
correctly filtered smaller stream in openStream(). This resulted
either in an IOE "short read of block" or in an EOFException
depending on the resulting filtered size.

Fix this by ensuring that getSize() does return the size of the
filtered stream.

Bug: 530106
Change-Id: I7c7c85036047dc10030ed29c1d5a6c7f34f2bdff
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-03-07 23:25:22 +01:00
David Pursehouse 9f689e90d4 MergeHeadMsgTest: Open FileOutputStream in try-with-resource
Change-Id: I8efa549b98bf661665dc29d48d0e5661b0e8530c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-07 14:49:21 +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 de96131d36 IndexDiffWithSymlinkTest: Open InputStream in try-with-resource
Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-07 08:25:15 +09:00
David Pursehouse 7b57ce5186 HugeFileTest: Open RandomAccessFile in try-with-resource
Change-Id: Iecb9a7348b40c91fa45c051c2a9c4eb47e4bdeca
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-07 08:14:08 +09:00
David Pursehouse c6ea82b9cc GetTextTest: Open InputStream in try-with-resource
Change-Id: I3b68686de2d852b1f0b19c267a4e527229b40316
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 17:37:22 +09:00
David Pursehouse 5f082de9bb FileSnapshotTest: Open FileOutputStream in try-with-resource
Change-Id: I187dd61e3e7d6f141722bf1af86a7fe04711057d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 17:19:59 +09:00
David Pursehouse ae1a53a148 EditListTest: Open InputStream in try-with-resource
Change-Id: Ib5b86e332ec674dec5460a9629d94d9f94c31c24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse 209bb6ea94 EGitPatchHistoryTest: Open BufferedReader in try-with-resource
Change-Id: I74aede463c7b0a478a1e0e8b680c206d3964061d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse 159388b1a6 T0003_BasicTest: Use CommitBuilder.setEncoding(Charset)
Change-Id: I1c4cdd4b856d715a204030d2de25ef91977186c2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse 657e414824 WalkEncryptionTest: Use StandardCharsets.UTF_8
Change-Id: I6eb8a33be62c452c264fb0560b988144d80a41f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse 751a08b2f4 GetTextTest: Use StandardCharsets constants instead of CharSet.forName
Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse 8d845ec549 EGitPatchHistoryTest: Set input stream encoding with constant
Change-Id: Ieff9b1d07704e37c8d5616b220b015855a7cc624
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:13 +09:00
David Pursehouse b9a03c69b3 DirCacheCheckoutTest: Open FileInputStream in try-with-resource
Change-Id: I3ceef36803752a19a4d74910b4db26c01279fd99
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:12 +09:00
David Pursehouse e3f8c0efb8 DiffFormatterReflowTest: Open InputStream in try-with-resource
Change-Id: Id7f420a2eac57e59fa3feb04236df6f5f8d07f02
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 16:56:12 +09:00
David Pursehouse 6d437a58f1 DescribeCommandTest: Open FileWriter in try-with-resource
Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 09:49:16 +09:00
David Pursehouse 06fbd7c5fa CommitCommandTest: Open Repository in try-with-resource
Change-Id: Id9961a120ef9f949f04fc95455fae06ba95d8031
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 08:24:28 +09:00
David Pursehouse f8cd892b27 CommitAndLogCommandTest: Open PrintWriter in try-with-resource
Change-Id: I0c7f07e27d1881d8856dac008110fcaa85c98fbb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 08:22:48 +09:00
David Pursehouse 3fd6a3857b CloneCommandTest: Open Repository in try-with-resource
Change-Id: Id09d2126fb17d84581f8637e83a75dfa2e85ebe8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-06 08:20:45 +09:00
David Pursehouse fd20f8c657 AutoCRLFInputStreamTest: Open auto-closeable resources in try-with-resource
Change-Id: I427ab43a82861f7bc69b104e29dc4360048aec4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 20:59:31 +09:00
David Pursehouse 8ab6f78d02 CleanCommandTest: Open Repository in try-with-resource
Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 20:56:38 +09:00
David Pursehouse 903f1d1639 CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource
Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 20:55:20 +09:00
David Pursehouse 3b250b371b AddCommandTest: Open PrintWriter in try-with-resource
Change-Id: I8ef769d12239447a20b670398293dbb64b90087d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 20:08:34 +09:00
David Pursehouse eaa7c20515 FileBasedConfigTest: Open FileOutputStream in try-with-resource
Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 17:16:14 +09:00
David Pursehouse 18f2cfc7d1 ReflogReaderTest: Open FileOutputStream in try-with-resource
Change-Id: I09af22292cc4b615b40a820dbc054282bb0c76b8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 16:35:09 +09:00
David Pursehouse c77e66dd1a ReflogReaderTest: Fix indentation
Change-Id: I981dc14065ce435034d2072cff77e7efaa2c5573
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 16:33:42 +09:00
David Pursehouse 5a1f8af589 ReflogWriterTest: Open FileInputStream in try-with-resource
Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 16:30:40 +09:00
David Pursehouse 88151ed620 RebaseCommandTest: Open BufferedReader in try-with-resource
Change-Id: If8d77431edfdaec4a49a3c4ffe66a99e6d31c682
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 16:23:50 +09:00
David Pursehouse 50cebd85a8 DirCacheCGitCompatabilityTest: Open BufferedReader in try-with-resource
Change-Id: I0494eb475954927743174941a7d6c06d8431f57f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 16:23:08 +09:00
David Pursehouse b498bc2a0e CheckoutCommandTest: Open FileInputStream in try-with-resource
Change-Id: I972958373ceaf4c3ae756559ccbc341506d4e72d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-05 10:59:43 +09:00
David Pursehouse 91a2be13e5 AbbreviationTest: Open FileOutputStream in try-with-resource
Change-Id: Id1d48da466251f9e4186f4674afba4b5901a4388
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-03-03 23:58:49 +01: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
Markus Duft d3ed64bcd4 LFS: support merge/rebase/cherry-pick/diff/compare with LFS files
Respect merge=lfs and diff=lfs attributes where required to replace (in
memory) the content of LFS pointers with the actual blob content from
the LFS storage (and vice versa when staging/merging).

Does not implement general support for merge/diff attributes for any
other use case apart from LFS.

Change-Id: Ibad8875de1e0bee8fe3a1dffb1add93111534cae
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-03-03 11:39:43 +01:00
David Pursehouse c2ff87e786 MergeGitAttributeTest: Open FileInputStream in try-with-resource
Change-Id: Iec85eea044c46a199b5b6f6bdbb3191d817dd441
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-02-26 17:48:42 +09:00