public static @Nullable StagedFileOrDirectory parseListTreeRecord(@NotNull VirtualFile root, @NotNull String line) {
    try {
      StringScanner s = new StringScanner(line);
      String permissions = s.spaceToken();
      String type = s.spaceToken();
      String hash = s.tabToken();
      String filePath = GitUtil.unescapePath(s.line());

      if ("tree".equals(type)) return new StagedDirectory(VcsUtil.getFilePath(root, filePath, true));
      if ("commit".equals(type)) return new StagedSubrepo(VcsUtil.getFilePath(root, filePath, true), hash);
      if (!"blob".equals(type)) return null;

      boolean executable = EXECUTABLE_MODE.equals(permissions);
      return new StagedFile(VcsUtil.getFilePath(root, filePath), hash, executable);
    }
    catch (VcsException e) {
      LOG.warn(e);
      return null;
    }
  }
public static @Nullable StagedFileOrDirectory parseListTreeRecord(@NotNull VirtualFile root, @NotNull String line)