Allow refs/* pattern on new reference rights
The reference name "refs/*" was being rejected because JGit's Repository.isValidRefName() method was passed "refs" and it requires there be at least one "/" in the name given. Use a special case for "refs/*" since we permit this to match any reference in the repository. Change-Id: I5e77819e8414ff7681928dcd53c2fdbbe2e0be0f Signed-off-by: Shawn O. Pearce <sop@google.com> Reviewed-by: Nico Sallembien <nsallembien@google.com>
This commit is contained in:
@@ -143,7 +143,7 @@ class AddRefRight extends Handler<ProjectDetail> {
|
||||
}
|
||||
if (refPattern.endsWith("/*")) {
|
||||
final String prefix = refPattern.substring(0, refPattern.length() - 2);
|
||||
if (!Repository.isValidRefName(prefix)) {
|
||||
if (!"refs".equals(prefix) && !Repository.isValidRefName(prefix)) {
|
||||
throw new InvalidNameException();
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user