diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2021-05-12 00:03:00 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-05-12 08:50:18 +0200 |
commit | 73f8acdc5c97e068143c86765995c4fb6923ee91 (patch) | |
tree | 0642fba11194dd69fd43917fb4de96130f62cf8a /org.eclipse.jgit | |
parent | 587c7eab45b0a50c754ad93860416a00ef08c17f (diff) | |
parent | adc1fc645f9643c5bda6a8ae3c602f6d42aaa70b (diff) | |
download | jgit-73f8acdc5c97e068143c86765995c4fb6923ee91.tar.gz jgit-73f8acdc5c97e068143c86765995c4fb6923ee91.zip |
Merge branch 'stable-5.8' into stable-5.9
* stable-5.8:
Remove texts which were added by mistake in 00386272
Fix formatting which was broken in 00386272
Change-Id: I9ca7a0237f87d1d4bcaba81e709eaa67902f27e5
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java index f57581a299..78262e9773 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java @@ -218,14 +218,14 @@ public class LockFile { int r; while ((r = fis.read(buf)) >= 0) { out.write(buf, 0, r); + } } - } - } catch (FileNotFoundException fnfe) { - if (ref.exists()) { - throw fnfe; - } - // Don't worry about a file that doesn't exist yet, it - // conceptually has no current content to copy. + } catch (FileNotFoundException fnfe) { + if (ref.exists()) { + throw fnfe; + } + // Don't worry about a file that doesn't exist yet, it + // conceptually has no current content to copy. } } catch (IOException | RuntimeException | Error ioe) { unlock(); @@ -322,17 +322,16 @@ public class LockFile { if (out == null) { os = getStream(); if (fsync) { - out = Channels.newOutputStream(os.getChannel()); + out = Channels.newOutputStream(os.getChannel()); } else { - out = os; + out = os; } } return out; } @Override - public void write(byte[] b, int o, int n) - throws IOException { + public void write(byte[] b, int o, int n) throws IOException { get().write(b, o, n); } @@ -359,10 +358,10 @@ public class LockFile { } if (out != null) { if (fsync) { - os.getChannel().force(true); + os.getChannel().force(true); } - out.close(); - os = null; + out.close(); + os = null; } written = true; } catch (IOException | RuntimeException | Error ioe) { |