static String gitRepoFilePath()

in src/main/java/com/googlesource/gerrit/plugins/findowners/Util.java [63:80]


  static String gitRepoFilePath(String file) {
    if (file == null) {
      return "";
    }
    int last = file.length() - 1;
    while (last >= 0 && file.charAt(last) == '/') {
      --last;
    }
    int first = 0;
    while (first < last && file.charAt(first) == '/') {
      ++first;
    }
    file = file.substring(first, last + 1);
    if (file.startsWith("./")) {
      return gitRepoFilePath(file.substring(2));
    }
    return file;
  }