diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2018-06-08 17:22:54 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-06-08 21:43:39 +0200 |
commit | 5f27032fb85694a093f827581216d4ffb99db68b (patch) | |
tree | 508b6fdaa5db0f0bbf49f648d0e9fe60a692d50b /org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | |
parent | 1cb8c5d7fe2d88c127bafcff3800b91e5ab5eda4 (diff) | |
download | jgit-5f27032fb85694a093f827581216d4ffb99db68b.tar.gz jgit-5f27032fb85694a093f827581216d4ffb99db68b.zip |
Use constant for ".lock"
Change-Id: Id65dc94c970ffd3ca3d3d4a5d57123c95d29e8af
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index fa283d0129..29cc19c43c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -48,6 +48,8 @@ package org.eclipse.jgit.lib; +import static org.eclipse.jgit.lib.Constants.LOCK_SUFFIX; + import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; @@ -1366,10 +1368,12 @@ public abstract class Repository implements AutoCloseable { */ public static boolean isValidRefName(String refName) { final int len = refName.length(); - if (len == 0) + if (len == 0) { return false; - if (refName.endsWith(".lock")) //$NON-NLS-1$ + } + if (refName.endsWith(LOCK_SUFFIX)) { return false; + } // Refs may be stored as loose files so invalid paths // on the local system must also be invalid refs. |