]> source.dussan.org Git - jgit.git/commitdiff
LockFile: log exception if creation of lock file failed 98/147398/1
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 9 Aug 2019 22:39:16 +0000 (00:39 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 9 Aug 2019 22:57:04 +0000 (00:57 +0200)
Change-Id: I4de75d12ec9e61193494916307289378cdb6220e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java

index 290a0a28efd34b28aac865cf260be3f8f8bda70c..cba892ef6811a3f187e610147fae86db8dd29251 100644 (file)
@@ -302,8 +302,9 @@ expectedLessThanGot=expected less than ''{0}'', got ''{1}''
 expectedPktLineWithService=expected pkt-line with ''# service=-'', got ''{0}''
 expectedReceivedContentType=expected Content-Type {0}; received Content-Type {1}
 expectedReportForRefNotReceived={0}: expected report for ref {1} not received
-failedAtomicFileCreation=Atomic file creation failed, number of hard links to file {0} was not 2 but {1}"
-failedToDetermineFilterDefinition=An exception occured while determining filter definitions
+failedAtomicFileCreation=Atomic file creation failed, number of hard links to file {0} was not 2 but {1}
+failedCreateLockFile=Creating lock file {} failed
+failedToDetermineFilterDefinition=An exception occurred while determining filter definitions
 failedUpdatingRefs=failed updating refs
 failureDueToOneOfTheFollowing=Failure due to one of the following:
 failureUpdatingFETCH_HEAD=Failure updating FETCH_HEAD: {0}
index 00aaa42b4745b6b5fa341839647e4fc18b049ff6..23950100d297be992ac5a43f1f37f52bf81db9d7 100644 (file)
@@ -364,6 +364,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String expectedReceivedContentType;
        /***/ public String expectedReportForRefNotReceived;
        /***/ public String failedAtomicFileCreation;
+       /***/ public String failedCreateLockFile;
        /***/ public String failedToDetermineFilterDefinition;
        /***/ public String failedUpdatingRefs;
        /***/ public String failureDueToOneOfTheFollowing;
index 420e7375431c1bd19722bfbe3bbb0ea44419c854..f7e78b94f774ae829725ad81d873f957118fa62a 100644 (file)
@@ -165,7 +165,12 @@ public class LockFile {
         */
        public boolean lock() throws IOException {
                FileUtils.mkdirs(lck.getParentFile(), true);
-               token = FS.DETECTED.createNewFileAtomic(lck);
+               try {
+                       token = FS.DETECTED.createNewFileAtomic(lck);
+               } catch (IOException e) {
+                       LOG.error(JGitText.get().failedCreateLockFile, lck, e);
+                       throw e;
+               }
                if (token.isCreated()) {
                        haveLck = true;
                        try {