diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-18 09:15:02 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-18 09:15:24 +0900 |
commit | 531da4e5e9bb4c1f1d2322c5a70bdc2dc86e1480 (patch) | |
tree | 671b8589d1b745424c9ee4d15b2585f292cd26f6 /org.eclipse.jgit | |
parent | db756e914708ff29d93c2cba040aa19ea1a485c6 (diff) | |
parent | 1a4e12a451217075310458b94a39bfc132abb276 (diff) | |
download | jgit-531da4e5e9bb4c1f1d2322c5a70bdc2dc86e1480.tar.gz jgit-531da4e5e9bb4c1f1d2322c5a70bdc2dc86e1480.zip |
Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
Fix ObjectUploadListener#close
Fix error handling in FileLfsServlet
ObjectDownloadListener#onWritePossible: Make code spec compatible
ObjectDownloadListener: Return from onWritePossible when data is written
Fix IOException when LockToken#close fails
Change-Id: Iad9836811be034cf992ea25dad4409addba75115
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index ed5b87d5ca..6f3877fc30 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -847,13 +847,18 @@ public abstract class FS { @Override public void close() { - if (link.isPresent()) { - try { - Files.delete(link.get()); - } catch (IOException e) { - LOG.error(MessageFormat.format(JGitText.get().closeLockTokenFailed, - this), e); - } + if (!link.isPresent()) { + return; + } + Path p = link.get(); + if (!Files.exists(p)) { + return; + } + try { + Files.delete(p); + } catch (IOException e) { + LOG.error(MessageFormat + .format(JGitText.get().closeLockTokenFailed, this), e); } } |