docs: private File processGitDirFile(@Nonnull File file) {
      try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
        // There should be just one line in the file, e.g.
        // "gitdir: /usr/local/src/parentproject/.git/modules/submodule"
        String line = reader.readLine();
        if (line == null) {
          return null;
        }
        // Separate the key and the value in the string.
        String[] parts = line.split(": ");
  
        // If we don't have 2 parts or if the key is not gitdir then give up.
        if (parts.length != 2 || !parts[0].equals("gitdir")) {
          return null;
        }
  
        // All seems ok so return the "gitdir" value read from the file.
        File gitDir = new File(parts[1]);
        if (gitDir.isAbsolute()) {
          // gitdir value is an absolute path. Return as-is
          return gitDir;
        } else {
          // gitdir value is relative.
          return new File(file.getParentFile(), parts[1]);
        }
      } catch (IOException e) {
        return null;
      }
    }