summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update API problem filterMatthias Sohn2018-10-191-1/+1
| | | | Change-Id: I66c0c490bb66adafac5d670d2d9571f1674a281e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-4.6' into stable-4.7David Pursehouse2018-10-190-0/+0
|\ | | | | | | | | | | | | | | | | * stable-4.6: Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: I3e1a870a225447e761368298ce9b65dbec2c2a82 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-4.5' into stable-4.6David Pursehouse2018-10-190-0/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.5: Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: I9c925a65d42559443ade9ac8291ffe00f4a1dda1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Merge branch 'stable-4.4' into stable-4.5David Pursehouse2018-10-190-0/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.4: Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: Icd66a796b0cce93c75a52cc77fec8f9df3eeccb4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | * Merge branch 'stable-4.3' into stable-4.4stable-4.4David Pursehouse2018-10-190-0/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.3: JGit v4.0.3.201509231615-r Change-Id: I147d81a9cc9c0f9e66084897df9c88c369539db7 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | * Merge branch 'stable-4.2' into stable-4.3stable-4.3David Pursehouse2018-10-190-0/+0
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.2: JGit v4.0.3.201509231615-r Change-Id: Ic90ef74497afee9da4b49dcb53302b4efa5b9f26 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * Merge branch 'stable-4.1' into stable-4.2stable-4.2David Pursehouse2018-10-190-0/+0
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.1: JGit v4.0.3.201509231615-r Change-Id: I6cc5bcefad2e8dee3394770d36608f981bfc9a9e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | | * Merge branch 'stable-4.0' into stable-4.1stable-4.1David Pursehouse2018-10-190-0/+0
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.0: JGit v4.0.3.201509231615-r Change-Id: Ie74b0392ef145ffd27dc903c45f7fec2d4492a17 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | | | * JGit v4.0.3.201509231615-rv4.0.3.201509231615-rstable-4.0Matthias Sohn2015-09-2346-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I7ec09e82d806cde61165a6ceb79de022f18d9fe2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * | | | | Prepare 4.4.2-SNAPSHOT buildsMatthias Sohn2016-07-1556-302/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1d75fb5bddb1a6dd23604ba57c9798c978afca89 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix file handle leak in ObjectDownloadListener.onWritePossibleMatthias Sohn2018-10-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5c134f4d removed closing the input stream when we reached end of the stream. This caused file handle leaks. Bug: 540049 Change-Id: I48082b537077c7471fc160f59aa04deb99687d9b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Merge branch 'stable-4.6' into stable-4.7David Pursehouse2018-10-132-11/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.6: Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Change-Id: I24417e4ebbba31f7ff6896d585ef807327411392 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | | | Merge branch 'stable-4.5' into stable-4.6David Pursehouse2018-10-132-10/+11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.5: Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Change-Id: I1c077e8f3530ac717b1603d3307fd15d4335b8fe Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * | | | | | Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xmlDavid Pursehouse2018-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If9cb0de7a0e7bd95eac7daeee140a18385192a48 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * | | | | | Replace FindBugs with SpotBugsDavid Pursehouse2018-10-091-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SpotBugs [1] is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community. This is a backport of [1] which originally did the replacement on the master branch. This change updates to the current latest version, so that we can get the benefit of its checks when pushing changes to the stable branches. [1] https://spotbugs.github.io/ [2] https://git.eclipse.org/r/#/c/101312/ Change-Id: Ib73d56b5980b55f4d7e09d87abec3138cac3d3dc Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | SubmoduleValidator: Remove unused import of ConfigConstantsDavid Pursehouse2018-10-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6afe5690bf9d1f1f4d414aa618daefc8b48d217e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | SubmoduleValidator: Permit missing path or urlJonathan Nieder2018-10-081-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A .gitmodules file can include a submodule without a path to configure the URL for a submodule that is only present on other branches. A .gitmodules file can include a submodule with no URL and no path to reserve the name for a submodule that existed in earlier history but is not available from any URL any more. "git fsck" permits both of these cases. Permit them in JGit as well (instead of throwing NullPointerException). Change-Id: I3b442639ad79ea7a59227f96406a12e62d3573ae Reported-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | | ObjectChecker#getGitsubmodules: Fix malformed javadocDavid Pursehouse2018-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The text "<tree, blob>" with angle brackets should not be used in javadoc since it is interpreted as an HTML tag and then rejected since it's not a valid HTML tag. Wrap the text in a @literal tag. Also add a missing space. Change-Id: Ide045e8c04a39a916f5b2e964e58c151e4555830 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Prepare 4.7.6-SNAPSHOT buildsMatthias Sohn2018-10-0656-321/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I99b59116999742d8d6cdba26287ea7c6eba11a30 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | JGit v4.7.5.201810051826-rv4.7.5.201810051826-rMatthias Sohn2018-10-0656-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I60c7a2eff3dab5083f71df0d9465a4e94b5e2513 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | BaseReceivePack: Validate incoming .gitmodules filesIvan Frade2018-10-055-1/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main concern are submodule urls starting with '-' that could pass as options to an unguarded tool. Pass through the parser the ids of blobs identified as .gitmodules files in the ObjectChecker. Load the blobs and parse/validate them in SubmoduleValidator. Change-Id: Ia0cc32ce020d288f995bf7bc68041fda36be1963 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | ObjectChecker: Report .gitmodules files found in the packIvan Frade2018-10-054-7/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to validate .gitmodules files, we first need to find them in the incoming pack. Do it in the ObjectChecker stage. Check in the tree objects if they point to a .gitmodules file and report the tree id and the .gitmodules blob id. This can be used later to check if the file is in the root of the project and if the contents are good. While we're here, make isMacHFSGit more accurate by detecting variants of filenames that vary in case. [jn: tweaked NTFS and HFS+ checking; added more tests] Change-Id: I70802e7d2c1374116149de4f89836b9498f39582 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | SubmoduleAddCommand: Reject submodule URIs that look like cli optionsIvan Frade2018-10-056-3/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C git versions before 2.19.1, the submodule is fetched by running "git clone <uri> <path>". A URI starting with "-" would be interpreted as an option, causing security problems. See CVE-2018-17456. Refuse to add submodules with URIs, names or paths starting with "-", that could be confused with command line arguments. [jn: backported to JGit 4.7.y, bringing portions of Masaya Suzuki's dotdot check code in v5.1.0.201808281540-m3~57 (Add API to specify the submodule name, 2018-07-12) along for the ride] Change-Id: I2607c3acc480b75ab2b13386fe2cac435839f017 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | ObjectDownloadListener#onWritePossible: Add comment on return statementDavid Ostrovsky2018-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not obvious why this return statement is needed. Clarify with a comment that otherwise endless loop may show up when recent versions of Jetty are used. Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | | | | | | Prepare 4.7.5-SNAPSHOT buildsMatthias Sohn2018-09-1856-321/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifce4311fe9429d751cec5b326b540d6233762153 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | JGit v4.7.4.201809180905-rv4.7.4.201809180905-rMatthias Sohn2018-09-1856-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iceee69df5fd593bece4532d5781e3771f5761ef8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Update API problem filterMatthias Sohn2018-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie15c7d0b320f75915c362f5bd3bd6b39d84a900a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix ObjectUploadListener#closeMatthias Sohn2018-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not try to set response status if response is already committed. Change-Id: I9a7c2871c86eb53416b905324775f3ed961c8ae6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix error handling in FileLfsServletMatthias Sohn2018-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check in #sendError method if the response was committed already. If yes we cannot set response status or send an error message, last resort is to close the outputstream. If the response wasn't yet committed first reset the response before using writer to send the error message to the client since mixing STREAM and WRITE mode (mixing asynchronous and blocking I/O) is illegal in servlet 3.1. see the following bugs in the gerrit and jetty issue trackers https://bugs.chromium.org/p/gerrit/issues/detail?id=9667 https://bugs.chromium.org/p/gerrit/issues/detail?id=9721 https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Ie35563c2e0ac1c5e918185a746622589a880dc7f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | ObjectDownloadListener#onWritePossible: Make code spec compatibleDavid Ostrovsky2018-09-171-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code violates the ServletOutputStream contract. For every out.isReady() == true either write or close of that ServletOutputStream should be called. See also this issue upstream for more context: [1]. [1] https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Ied575f3603a6be0d2dafc6c3329d685fc212c7a3 Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | ObjectDownloadListener: Return from onWritePossible when data is writtenDavid Ostrovsky2018-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When buffer was written not only call AsyncContext#complete() but also return from the ObjectDownloadListener#onWritePossible(). This avoids endless loop after upgrading from Jetty 9.3.x to 9.4.x lines. In Jetty example implementation:[1] the return statemnt is also used: // If we are at EOF then complete   if (len < 0)   {    async.complete();     return;   } See also this issue upstream: [2]. [1] https://webtide.com/servlet-3-1-async-io-and-jetty [2] https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Iac73fb25e67d40228a378a8e34103f1d28b72a76 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | | | | | | Fix IOException when LockToken#close failsMatthias Sohn2018-09-151-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened if the LockTokens hard link was already deleted earlier. Bug: 531759 Change-Id: Idc84bd695fac1a763b3cbb797c9c4c636a16e329 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix NoSuchFileException during directory cleanup in RefDirectoryMatthias Sohn2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 538285 Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> (cherry picked from commit 8ab89ef066f91a7d39b705f4e61498f37291ffab) Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Externalize warning message in RefDirectory.delete()Matthias Sohn2018-09-113-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Icec16c01853a3f5ea016d454b3d48624498efcce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> (cherry picked from commit 5e68fe245fb97f38620ea683dbeab724bf86da4c) Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Suppress warning for trying to delete non-empty directoryThomas Wolf2018-09-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually a fairly common occurrence; deleting the parent directories can work only if the file deleted was the last one in the directory. Bug: 537872 Change-Id: I86d1d45e1e2631332025ff24af8dfd46c9725711 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> (cherry picked from commit d9e767b431eae7978613cc8e0ade7467ec04376c) Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Prepare 4.7.4-SNAPSHOT buildsMatthias Sohn2018-09-0956-321/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie4d17e1604270946606e75145012c5b7fa1283eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | JGit v4.7.3.201809090215-rv4.7.3.201809090215-rMatthias Sohn2018-09-0956-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1ded7a2b61235509c5a6ba95e7329e288bbfddb1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix atomic lock file creation on NFSMatthias Sohn2018-09-075-6/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FS_POSIX.createNewFile(File) failed to properly implement atomic file creation on NFS using the algorithm [1]: - name of the hard link must be unique to prevent that two processes using different NFS clients try to create the same link. This would render nlink useless to detect if there was a race. - the hard link must be retained for the lifetime of the file since we don't know when the state of the involved NFS clients will be synchronized. This depends on NFS configuration options. To fix these issues we need to change the signature of createNewFile which would break API. Hence deprecate the old method FS.createNewFile(File) and add a new method createNewFileAtomic(File). The new method returns a LockToken which needs to be retained by the caller (LockFile) until all involved NFS clients synchronized their state. Since we don't know when the NFS caches are synchronized we need to retain the token until the corresponding file is no longer needed. The LockToken must be closed after the LockFile using it has been committed or unlocked. On Posix, if core.supportsAtomicCreateNewFile = false this will delete the hard link which guarded the atomic creation of the file. When acquiring the lock fails ensure that the hard link is removed. [1] https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html also see file creation flag O_EXCL in http://man7.org/linux/man-pages/man2/open.2.html Change-Id: I84fcb16143a5f877e9b08c6ee0ff8fa4ea68a90d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Use constant for ".lock"Matthias Sohn2018-09-077-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 5f27032fb85694a093f827581216d4ffb99db68b) Change-Id: I6bc0e9a910b110418a82d8e574fb2aecc3a31d6a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix handling of option core.supportsAtomicCreateNewFileChristian Halstrick2018-09-071-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When core.supportsAtomicCreateNewFile was set to false and the repository was located on a filesystem which doesn't support the file attribute "unix:nlink" then FS_POSIX#createNewFile may report an error even if everything was ok. Modify FS_POSIX#createNewFile to silently ignore this situation. An example of such a filesystem is sshfs where reading "unix:nlink" always returns 1 (instead of throwing a exception). Bug: 537969 Change-Id: I6deda7672fa7945efa8706ea1cd652272604ff19 Also-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | GC: Avoid logging errors when deleting non-empty foldersHector Caballero2018-09-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I88304d34c and Ia555bce00 modified the way errors are handled when trying to delete non-empty reference folders. Before, this error was silently ignored as it was considered an expected output. Now, every failed folder delete is logged which can be noisy. Ignore the DirectoryNotEmptyException but log any other error avoiding deletion of an eligible folder. Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com> Change-Id: I194512f67885231d62c03976ae683e5cc450ec7c
* | | | | | | | Bazel: Use hyphen instead of underscore in external repository namesDavid Pursehouse2018-08-302-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent Bazel versions support the hyphen character in external repository names. On the Gerrit project, the repository names were harmonized to consistently use hyphen. As a side effect, it is no longer possible to build jgit from source in the gerrit tree, due to the different repository names. Rename the dependencies to use hyphens, consistent with gerrit. Change-Id: Ideebd858ddd3f0e6f765643001642dfb6c12441f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Bazel: Format all build files with buildifier 0.15.0David Pursehouse2018-08-304-62/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I8343b723da6e40d5ae7fc45c84f64c31276bd5dc Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | ChangeIdUtilTest: Remove unused notestCommitDashVDavid Pursehouse2018-08-301-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was never being run. Since it was introduced it was named "notest.." which meant it didn't run with JUnit3, and since it is not annotated @Test it also doesn't run with JUnit4. When compiling with Bazel 0.6.0, error-prone raises an error that the public method is not annotated with @Ignore or @Test. Given that the test has never been run anyway, we can just remove it. Bug: 525415 Change-Id: Ie9a54f89fe42e0c201f547ff54ff1d419ce37864 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Fix GC run in foreground to not use executorHugo Arès2018-08-152-55/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since I3870cadb4, GC task was always delegated to an executor even when background option was set to false. This was an issue because if more than one GC object was instantiated and executed in parallel, only one GC was actually running because of the single thread executor. Change-Id: I8c587d22d63c1601b7d75914692644a385cd86d6 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | | | | | | | Prepare 4.7.3-SNAPSHOT buildsMatthias Sohn2018-07-2756-321/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5c437f45d5bc469e3c32bef1180c127d96d24d23 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | JGit v4.7.2.201807261330-rv4.7.2.201807261330-rMatthias Sohn2018-07-2656-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0d8c7ca756e6236e315c91da000fe8103ce83d05 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Delete all loose refs empty directoriesLuca Milanesio2018-07-264-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Use java.nio to delete path to get detailed errorsLuca Milanesio2018-07-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get the full IOException of the reason why a directory cannot be removed during GC. Change-Id: Ia555bce009fa48087a73d677f1ce3b9c0b685b57 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | GC: Remove empty references foldersHector Caballero2018-07-102-0/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>