summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* TemporaryBufferTest: Suppress "should be managed by try-with-resource"David Pursehouse2018-03-131-1/+12
| | | | | | | | | | 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>
* Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-1325-450/+372
| | | | | | | | | | | | | | | | | | | | 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>
* Implement --force option in FetchCommand and CLI fetch commandMatthias Sohn2018-03-131-0/+19
| | | | Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-1128-200/+200
| | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove deprecated IgnoreNode#isIgnored methodMatthias Sohn2018-03-101-14/+0
| | | | | | Parameter negateFirstMatch is not honored anymore Change-Id: Idff1a92643c1431c7e34a7730f8414135e1ac196 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix misspelled class name: EmtpyCommitException -> EmptyCommitExceptionDavid Pursehouse2018-03-101-3/+3
| | | | | Change-Id: I55196020146f26951988988c14ac9a6f85061ae2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove deprecated ArchiveCommand#putEntry methodMatthias Sohn2018-03-091-5/+0
| | | | | | | Use #putEntry(Closeable, ObjectId, String, FileMode, ObjectLoader)} instead. Change-Id: I2c58c07da00c6033c583eb2dc6c3a0889661f5f5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.0.0-SNAPSHOT buildsMatthias Sohn2018-03-082-47/+47
| | | | | Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.1-SNAPSHOT buildsMatthias Sohn2018-03-082-47/+47
| | | | | Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.11.0.201803080745-rv4.11.0.201803080745-rMatthias Sohn2018-03-082-2/+2
| | | | | Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix DiffFormatter for diffs against working tree with autocrlf=trueThomas Wolf2018-03-071-0/+98
| | | | | | | | | | | | | | 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>
* MergeHeadMsgTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-03-071-15/+7
| | | | | Change-Id: I8efa549b98bf661665dc29d48d0e5661b0e8530c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Use StandardCharsets.UTF_8 in testsDavid Pursehouse2018-03-075-6/+8
| | | | | | | Replace hard-coded "UTF-8" string with the constant. Change-Id: Ie812add2df28e984090563ec7c6e2c0366616424 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* IndexDiffWithSymlinkTest: Open InputStream in try-with-resourceDavid Pursehouse2018-03-071-6/+4
| | | | | Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* HugeFileTest: Open RandomAccessFile in try-with-resourceDavid Pursehouse2018-03-071-23/+23
| | | | | Change-Id: Iecb9a7348b40c91fa45c051c2a9c4eb47e4bdeca Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* GetTextTest: Open InputStream in try-with-resourceDavid Pursehouse2018-03-061-16/+10
| | | | | Change-Id: I3b68686de2d852b1f0b19c267a4e527229b40316 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* FileSnapshotTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-03-061-4/+1
| | | | | Change-Id: I187dd61e3e7d6f141722bf1af86a7fe04711057d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* EditListTest: Open InputStream in try-with-resourceDavid Pursehouse2018-03-061-8/+5
| | | | | Change-Id: Ib5b86e332ec674dec5460a9629d94d9f94c31c24 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* EGitPatchHistoryTest: Open BufferedReader in try-with-resourceDavid Pursehouse2018-03-061-19/+19
| | | | | Change-Id: I74aede463c7b0a478a1e0e8b680c206d3964061d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* T0003_BasicTest: Use CommitBuilder.setEncoding(Charset)David Pursehouse2018-03-061-1/+2
| | | | | Change-Id: I1c4cdd4b856d715a204030d2de25ef91977186c2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* WalkEncryptionTest: Use StandardCharsets.UTF_8David Pursehouse2018-03-061-4/+1
| | | | | Change-Id: I6eb8a33be62c452c264fb0560b988144d80a41f9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* GetTextTest: Use StandardCharsets constants instead of CharSet.forNameDavid Pursehouse2018-03-061-6/+8
| | | | | Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* EGitPatchHistoryTest: Set input stream encoding with constantDavid Pursehouse2018-03-061-1/+1
| | | | | Change-Id: Ieff9b1d07704e37c8d5616b220b015855a7cc624 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DirCacheCheckoutTest: Open FileInputStream in try-with-resourceDavid Pursehouse2018-03-061-11/+13
| | | | | Change-Id: I3ceef36803752a19a4d74910b4db26c01279fd99 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DiffFormatterReflowTest: Open InputStream in try-with-resourceDavid Pursehouse2018-03-061-8/+5
| | | | | Change-Id: Id7f420a2eac57e59fa3feb04236df6f5f8d07f02 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DescribeCommandTest: Open FileWriter in try-with-resourceDavid Pursehouse2018-03-061-3/+3
| | | | | Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CommitCommandTest: Open Repository in try-with-resourceDavid Pursehouse2018-03-061-6/+6
| | | | | Change-Id: Id9961a120ef9f949f04fc95455fae06ba95d8031 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CommitAndLogCommandTest: Open PrintWriter in try-with-resourceDavid Pursehouse2018-03-061-15/+15
| | | | | Change-Id: I0c7f07e27d1881d8856dac008110fcaa85c98fbb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CloneCommandTest: Open Repository in try-with-resourceDavid Pursehouse2018-03-061-11/+11
| | | | | Change-Id: Id09d2126fb17d84581f8637e83a75dfa2e85ebe8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* AutoCRLFInputStreamTest: Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-051-17/+16
| | | | | Change-Id: I427ab43a82861f7bc69b104e29dc4360048aec4e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CleanCommandTest: Open Repository in try-with-resourceDavid Pursehouse2018-03-051-2/+3
| | | | | Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resourceDavid Pursehouse2018-03-051-4/+4
| | | | | Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* AddCommandTest: Open PrintWriter in try-with-resourceDavid Pursehouse2018-03-051-99/+100
| | | | | Change-Id: I8ef769d12239447a20b670398293dbb64b90087d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* FileBasedConfigTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-03-051-4/+1
| | | | | Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ReflogReaderTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-03-051-4/+1
| | | | | Change-Id: I09af22292cc4b615b40a820dbc054282bb0c76b8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ReflogReaderTest: Fix indentationDavid Pursehouse2018-03-051-14/+14
| | | | | Change-Id: I981dc14065ce435034d2072cff77e7efaa2c5573 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ReflogWriterTest: Open FileInputStream in try-with-resourceDavid Pursehouse2018-03-051-4/+1
| | | | | Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* RebaseCommandTest: Open BufferedReader in try-with-resourceDavid Pursehouse2018-03-051-5/+2
| | | | | Change-Id: If8d77431edfdaec4a49a3c4ffe66a99e6d31c682 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DirCacheCGitCompatabilityTest: Open BufferedReader in try-with-resourceDavid Pursehouse2018-03-051-10/+4
| | | | | Change-Id: I0494eb475954927743174941a7d6c06d8431f57f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CheckoutCommandTest: Open FileInputStream in try-with-resourceDavid Pursehouse2018-03-051-8/+2
| | | | | Change-Id: I972958373ceaf4c3ae756559ccbc341506d4e72d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* AbbreviationTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-03-031-1/+4
| | | | | Change-Id: Id1d48da466251f9e4186f4674afba4b5901a4388 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable warning for resources not managed by try-with-resourceDavid Pursehouse2018-03-031-1/+1
| | | | | Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LFS: support merge/rebase/cherry-pick/diff/compare with LFS filesMarkus Duft2018-03-032-8/+4
| | | | | | | | | | | | 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>
* MergeGitAttributeTest: Open FileInputStream in try-with-resourceDavid Pursehouse2018-02-261-27/+17
| | | | | Change-Id: Iec85eea044c46a199b5b6f6bdbb3191d817dd441 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* PullCommandWithRebaseTest: Open File{Input|Output}Stream in try-with-resourceDavid Pursehouse2018-02-261-13/+2
| | | | | Change-Id: I1ff707ab7bab676603907f4c0bb1bc495503055b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* RecursiveMergerTest: Open FileOutputStream in try-with-resourceDavid Pursehouse2018-02-261-33/+28
| | | | | Change-Id: I158333d6393fb807bc21fba23fec7ad474384471 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* PullCommandTest: Use try-with-resources for File{Input,Output}StreamDavid Pursehouse2018-02-261-13/+2
| | | | | Change-Id: I09242eb289655c7554aefa9e0817d9b881db656b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add ObjectIdSerializerDavid Pursehouse2018-02-251-0/+88
| | | | | | | | | | | | | | | 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>
* CheckoutCommandTest: Fix name of created temp fileDavid Pursehouse2018-02-251-1/+1
| | | | | Change-Id: I29048f83aee3848679bbc6ded09dd3dd4a2ea35b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* IgnoreNodeTest: Suppress deprecation warnings in testEmptyIgnoreNodeDavid Pursehouse2018-02-251-0/+1
| | | | | Change-Id: I930c9408cc702af911419f2a7b3d03f652a2d4e3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>