summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-22 16:37:38 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-23 16:54:14 -0700
commitb3254d1159b30573b5f658394cefe877f44c4b78 (patch)
tree0c191bc6e247380d6fa7dfa6d1f236e643c7a1a9 /org.eclipse.jgit
parent252cd74eb0a5611bb09fb696107c10793e0dbca4 (diff)
downloadjgit-b3254d1159b30573b5f658394cefe877f44c4b78.tar.gz
jgit-b3254d1159b30573b5f658394cefe877f44c4b78.zip
isValidRefName: Inline the forbidden ref suffix of ".lock"
A Git reference name must never end with ".lock", as it would confuse any existing C client that tries to obtain a clone of the repository over the network. Even if the repository isn't on a local filesystem, it still should ban that suffix. Because I plan to move LockFile to storage.file and make it a private implementation detail of the local file system storage model, we can't rely on its package level SUFFIX field here. Making it public probably won't work long-term either, as I also plan to pull storage.file into its own separate project that depends on the core library. So, just inline the constant here. Its as foribidden as ":" is. Change-Id: If85076861baeacc183b82696375a13e935ba8836 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java2
1 files changed, 1 insertions, 1 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 a71640460d..350d11f43b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -1248,7 +1248,7 @@ public class Repository {
final int len = refName.length();
if (len == 0)
return false;
- if (refName.endsWith(LockFile.SUFFIX))
+ if (refName.endsWith(".lock"))
return false;
int components = 1;