Ejemplo n.º 1
0
        public int compare(VcsRef ref1, VcsRef ref2) {
          VcsRefType type1 = ref1.getType();
          VcsRefType type2 = ref2.getType();

          int typeComparison = REF_TYPE_COMPARATOR.compare(type1, type2);
          if (typeComparison != 0) {
            return typeComparison;
          }

          //noinspection UnnecessaryLocalVariable
          VcsRefType type = type1; // common type
          if (type == BRANCH) {
            if (ref1.getName().equals(DEFAULT)) {
              return -1;
            }
            if (ref2.getName().equals(DEFAULT)) {
              return 1;
            }
            return ref1.getName().compareTo(ref2.getName());
          }
          return ref1.getName().compareTo(ref2.getName());
        }
Ejemplo n.º 2
0
 @Override
 public boolean equals(@NotNull VcsRef ref1, @NotNull VcsRef ref2) {
   return ref1.getName().equals(ref2.getName()) && ref1.getType().equals(ref2.getType());
 }
Ejemplo n.º 3
0
 @Override
 public int computeHashCode(@NotNull VcsRef ref) {
   return 31 * ref.getName().hashCode() + ref.getType().hashCode();
 }
Ejemplo n.º 4
0
 @Override
 public String fun(VcsRef ref) {
   return ref.getType() == GitRefManager.TAG ? ref.getName() : null;
 }