Make Branch.NameKey enforce full ref names

Also remove some now redundant ref fixes before constructing
Branch.NameKeys.  This reduces the proliferation of "correcting" code.

Change-Id: I5d9864d7c6ea7252f05a4ccabcf124cb014c4fae
This commit is contained in:
Martin Fick
2015-04-13 10:41:14 -06:00
committed by David Pursehouse
parent c16ab0df0d
commit 4ddbfc9a8b
6 changed files with 14 additions and 20 deletions

View File

@@ -36,9 +36,9 @@ public final class Branch {
projectName = new Project.NameKey();
}
public NameKey(final Project.NameKey proj, final String n) {
public NameKey(final Project.NameKey proj, final String branchName) {
projectName = proj;
branchName = n;
set(branchName);
}
@Override
@@ -48,7 +48,7 @@ public final class Branch {
@Override
protected void set(String newValue) {
branchName = newValue;
branchName = RefNames.fullName(newValue);
}
@Override