diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-08-12 12:18:16 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-08-12 12:18:16 +0200 |
commit | 6ef225c5191f0e0c7ffc621843528568455d72a1 (patch) | |
tree | 1b832a8c50cd5d482af2c5ec7e368d5f93f31a82 | |
parent | cc29da8e0f228867205331ec918e3cc17dcfecb8 (diff) | |
download | jgit-6ef225c5191f0e0c7ffc621843528568455d72a1.tar.gz jgit-6ef225c5191f0e0c7ffc621843528568455d72a1.zip |
Handle InvalidPathException in FS_POSIX#createNewFileAtomic
Bug: 547400
Change-Id: Ic3541e360a2968ba3532a3d3fa4828b0d0463c02
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index 03b94ee118..8561f6f3a2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java @@ -50,6 +50,7 @@ import java.io.PrintStream; import java.nio.charset.Charset; import java.nio.file.FileAlreadyExistsException; import java.nio.file.Files; +import java.nio.file.InvalidPathException; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.PosixFilePermission; @@ -448,7 +449,7 @@ public class FS_POSIX extends FS { try { path = file.toPath(); Files.createFile(path); - } catch (FileAlreadyExistsException e) { + } catch (FileAlreadyExistsException | InvalidPathException e) { return token(false, null); } if (supportsAtomicCreateNewFile() || !supportsUnixNLink) { |