David Pursehouse
da3d76f00e
Use CHARSET in FileOutputStream instead of hard-coded "UTF-8"
...
Change-Id: I63ad25e1ebd94081c8848f4d21044cf9041f971d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
bf757cd1c6
TemporaryBufferTest: Suppress "should be managed by try-with-resource"
...
In most of the tests, the temporary buffer is explicitly destroyed in
a finally block after being closed. This is not possible if using the
try-with-resource construct, because the variable is not accessible in
the finally block scope.
Change-Id: I3bab30695ddd12e1a0ae107989638428fe3ef551
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
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>
7 years ago
Matthias Sohn
e23b09ad6e
Implement --force option in FetchCommand and CLI fetch command
...
Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
David Pursehouse
f07b60239c
Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8
...
Change-Id: I6714fc3666e1bced22abba94ceb700477349586e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
Matthias Sohn
f0ab2d07b8
Remove deprecated IgnoreNode#isIgnored method
...
Parameter negateFirstMatch is not honored anymore
Change-Id: Idff1a92643c1431c7e34a7730f8414135e1ac196
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
David Pursehouse
9441508682
Fix misspelled class name: EmtpyCommitException -> EmptyCommitException
...
Change-Id: I55196020146f26951988988c14ac9a6f85061ae2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
Matthias Sohn
653b31a903
Remove deprecated ArchiveCommand#putEntry method
...
Use #putEntry(Closeable, ObjectId, String, FileMode, ObjectLoader)}
instead.
Change-Id: I2c58c07da00c6033c583eb2dc6c3a0889661f5f5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
Matthias Sohn
d0f1f5eef6
Prepare 5.0.0-SNAPSHOT builds
...
Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
Matthias Sohn
f389e18a28
Prepare 4.11.1-SNAPSHOT builds
...
Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
Matthias Sohn
f944063517
JGit v4.11.0.201803080745-r
...
Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
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>
7 years ago
David Pursehouse
9f689e90d4
MergeHeadMsgTest: Open FileOutputStream in try-with-resource
...
Change-Id: I8efa549b98bf661665dc29d48d0e5661b0e8530c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
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>
7 years ago
David Pursehouse
de96131d36
IndexDiffWithSymlinkTest: Open InputStream in try-with-resource
...
Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
7b57ce5186
HugeFileTest: Open RandomAccessFile in try-with-resource
...
Change-Id: Iecb9a7348b40c91fa45c051c2a9c4eb47e4bdeca
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
c6ea82b9cc
GetTextTest: Open InputStream in try-with-resource
...
Change-Id: I3b68686de2d852b1f0b19c267a4e527229b40316
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
5f082de9bb
FileSnapshotTest: Open FileOutputStream in try-with-resource
...
Change-Id: I187dd61e3e7d6f141722bf1af86a7fe04711057d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
ae1a53a148
EditListTest: Open InputStream in try-with-resource
...
Change-Id: Ib5b86e332ec674dec5460a9629d94d9f94c31c24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
209bb6ea94
EGitPatchHistoryTest: Open BufferedReader in try-with-resource
...
Change-Id: I74aede463c7b0a478a1e0e8b680c206d3964061d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
159388b1a6
T0003_BasicTest: Use CommitBuilder.setEncoding(Charset)
...
Change-Id: I1c4cdd4b856d715a204030d2de25ef91977186c2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
657e414824
WalkEncryptionTest: Use StandardCharsets.UTF_8
...
Change-Id: I6eb8a33be62c452c264fb0560b988144d80a41f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
751a08b2f4
GetTextTest: Use StandardCharsets constants instead of CharSet.forName
...
Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
8d845ec549
EGitPatchHistoryTest: Set input stream encoding with constant
...
Change-Id: Ieff9b1d07704e37c8d5616b220b015855a7cc624
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
b9a03c69b3
DirCacheCheckoutTest: Open FileInputStream in try-with-resource
...
Change-Id: I3ceef36803752a19a4d74910b4db26c01279fd99
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
e3f8c0efb8
DiffFormatterReflowTest: Open InputStream in try-with-resource
...
Change-Id: Id7f420a2eac57e59fa3feb04236df6f5f8d07f02
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
6d437a58f1
DescribeCommandTest: Open FileWriter in try-with-resource
...
Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
06fbd7c5fa
CommitCommandTest: Open Repository in try-with-resource
...
Change-Id: Id9961a120ef9f949f04fc95455fae06ba95d8031
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
f8cd892b27
CommitAndLogCommandTest: Open PrintWriter in try-with-resource
...
Change-Id: I0c7f07e27d1881d8856dac008110fcaa85c98fbb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
3fd6a3857b
CloneCommandTest: Open Repository in try-with-resource
...
Change-Id: Id09d2126fb17d84581f8637e83a75dfa2e85ebe8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
fd20f8c657
AutoCRLFInputStreamTest: Open auto-closeable resources in try-with-resource
...
Change-Id: I427ab43a82861f7bc69b104e29dc4360048aec4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
8ab6f78d02
CleanCommandTest: Open Repository in try-with-resource
...
Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
903f1d1639
CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource
...
Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
3b250b371b
AddCommandTest: Open PrintWriter in try-with-resource
...
Change-Id: I8ef769d12239447a20b670398293dbb64b90087d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
eaa7c20515
FileBasedConfigTest: Open FileOutputStream in try-with-resource
...
Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
18f2cfc7d1
ReflogReaderTest: Open FileOutputStream in try-with-resource
...
Change-Id: I09af22292cc4b615b40a820dbc054282bb0c76b8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
c77e66dd1a
ReflogReaderTest: Fix indentation
...
Change-Id: I981dc14065ce435034d2072cff77e7efaa2c5573
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
5a1f8af589
ReflogWriterTest: Open FileInputStream in try-with-resource
...
Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
88151ed620
RebaseCommandTest: Open BufferedReader in try-with-resource
...
Change-Id: If8d77431edfdaec4a49a3c4ffe66a99e6d31c682
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
50cebd85a8
DirCacheCGitCompatabilityTest: Open BufferedReader in try-with-resource
...
Change-Id: I0494eb475954927743174941a7d6c06d8431f57f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
b498bc2a0e
CheckoutCommandTest: Open FileInputStream in try-with-resource
...
Change-Id: I972958373ceaf4c3ae756559ccbc341506d4e72d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
91a2be13e5
AbbreviationTest: Open FileOutputStream in try-with-resource
...
Change-Id: Id1d48da466251f9e4186f4674afba4b5901a4388
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
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>
7 years ago
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>
7 years ago
David Pursehouse
c2ff87e786
MergeGitAttributeTest: Open FileInputStream in try-with-resource
...
Change-Id: Iec85eea044c46a199b5b6f6bdbb3191d817dd441
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
8212924ede
PullCommandWithRebaseTest: Open File{Input|Output}Stream in try-with-resource
...
Change-Id: I1ff707ab7bab676603907f4c0bb1bc495503055b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
ca7d3e2734
RecursiveMergerTest: Open FileOutputStream in try-with-resource
...
Change-Id: I158333d6393fb807bc21fba23fec7ad474384471
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
4651d01e29
PullCommandTest: Use try-with-resources for File{Input,Output}Stream
...
Change-Id: I09242eb289655c7554aefa9e0817d9b881db656b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago
David Pursehouse
f0b46e1db4
Add ObjectIdSerializer
...
This is based on the ObjectIdSerialization class written by Shawn Pearce
for the Gerrit Code Review project in 2009 [1]. As mentioned in the
commit message there, it should be part of core JGit.
This implementation is slightly different to Shawn's version. Rather
than having separate methods for null/non-null ids, single methods are
implemented with @Nullable annotations.
[1] https://gerrit-review.googlesource.com/c/gerrit/+/9792
Change-Id: I7599cf8bd1ecd546e2252783d6d672eb76804060
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago
David Pursehouse
eba04da7be
CheckoutCommandTest: Fix name of created temp file
...
Change-Id: I29048f83aee3848679bbc6ded09dd3dd4a2ea35b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years ago