From: Matthias Sohn Date: Sat, 8 Sep 2018 09:06:28 +0000 (+0200) Subject: Merge branch 'stable-4.11' into stable-5.0 X-Git-Tag: v5.0.3.201809091024-r~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F128950%2F1;p=jgit.git Merge branch 'stable-4.11' into stable-5.0 * stable-4.11: Fix atomic lock file creation on NFS Use constant for ".lock" Fix handling of option core.supportsAtomicCreateNewFile GC: Avoid logging errors when deleting non-empty folders Change-Id: Ifcc8bfab4fd05c18a08dd82588860dffd0e6d726 Signed-off-by: Matthias Sohn --- 155dd1c5be9248e9271f708b970e6868d0461558 diff --cc org.eclipse.jgit/.settings/.api_filters index 0000000000,48051e14fb..803a29a5ec mode 000000,100644..100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@@ -1,0 -1,38 +1,29 @@@ + + + + + - - - - - - - - - - - ++ ++ + + + + + + + - ++ + + + + + + + + - ++ + + + + + diff --cc org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 576d0c7699,3f845556e1..eaaf7f01bb --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@@ -729,8 -723,8 +731,9 @@@ unknownObjectType=Unknown object type { unknownObjectType2=unknown unknownRepositoryFormat=Unknown repository format unknownRepositoryFormat2=Unknown repository format "{0}"; expected "0". +unknownTransportCommand=unknown command {0} unknownZlibError=Unknown zlib error. + unlockLockFileFailed=Unlocking LockFile ''{0}'' failed unmergedPath=Unmerged path: {0} unmergedPaths=Repository contains unmerged paths unpackException=Exception while parsing pack stream diff --cc org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index a52fab926a,d3514344d8..5776ef2112 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@@ -790,8 -784,8 +792,9 @@@ public class JGitText extends Translati /***/ public String unknownObjectType2; /***/ public String unknownRepositoryFormat; /***/ public String unknownRepositoryFormat2; + /***/ public String unknownTransportCommand; /***/ public String unknownZlibError; + /***/ public String unlockLockFileFailed; /***/ public String unmergedPath; /***/ public String unmergedPaths; /***/ public String unpackException; diff --cc org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index 3abf4dc5e5,45237c42be..8795329bf9 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java @@@ -383,15 -391,19 +391,19 @@@ public class FS_POSIX extends FS return true; } Path lockPath = lock.toPath(); - Path link = Files.createLink(Paths.get(lock.getAbsolutePath() + ".lnk"), //$NON-NLS-1$ - lockPath); + Path link = null; try { + link = Files.createLink( + Paths.get(lock.getAbsolutePath() + ".lnk"), //$NON-NLS-1$ + lockPath); Integer nlink = (Integer) (Files.getAttribute(lockPath, "unix:nlink")); //$NON-NLS-1$ - if (nlink != 2) { + if (nlink > 2) { - LOG.warn("nlink of link to lock file {0} was not 2 but {1}", //$NON-NLS-1$ + LOG.warn("nlink of link to lock file {} was not 2 but {}", //$NON-NLS-1$ lock.getPath(), nlink); return false; + } else if (nlink < 2) { + supportsUnixNLink = false; } return true; } catch (UnsupportedOperationException | IllegalArgumentException e) {