RefNames: Add support for refs/tags/ in shortName()
Change-Id: Iced6b55f2ddc11d31d21ae3a2db476d283b67efa
This commit is contained in:
@@ -21,6 +21,8 @@ public class RefNames {
|
|||||||
|
|
||||||
public static final String REFS_HEADS = "refs/heads/";
|
public static final String REFS_HEADS = "refs/heads/";
|
||||||
|
|
||||||
|
public static final String REFS_TAGS = "refs/tags/";
|
||||||
|
|
||||||
public static final String REFS_CHANGES = "refs/changes/";
|
public static final String REFS_CHANGES = "refs/changes/";
|
||||||
|
|
||||||
/** Note tree listing commits we refuse {@code refs/meta/reject-commits} */
|
/** Note tree listing commits we refuse {@code refs/meta/reject-commits} */
|
||||||
@@ -62,9 +64,12 @@ public class RefNames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final String shortName(String ref) {
|
public static final String shortName(String ref) {
|
||||||
return ref.startsWith(REFS_HEADS)
|
if (ref.startsWith(REFS_HEADS)) {
|
||||||
? ref.substring(REFS_HEADS.length())
|
return ref.substring(REFS_HEADS.length());
|
||||||
: ref;
|
} else if (ref.startsWith(REFS_TAGS)) {
|
||||||
|
return ref.substring(REFS_TAGS.length());
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String refsUsers(Account.Id accountId) {
|
public static String refsUsers(Account.Id accountId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user