Yup.  Repository.shortenRefName().  Unfortunately its not static, even though it doesn't use any local state.  You might want to consider refactoring that method to be static first so you can reuse it here.

Actually, I'm inclined to say it should move to Ref (which is hard because Ref is an interface and not an abstract class) and be both static and an instance member:

  public static String shortenRefName(String refName);

  public String getShortName() {
    return shortenRefName(getName());
  }