Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Opening a submodule bump in the PR changes view fails: "Unable to read file ... that is actually a directory"

未关闭
#8,981 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@alexr00 已经在做这个了。

开始于 2026年9月24日。

评估

这个 Issue 还没有评估数据。

描述

Description

When a PR bumps a git submodule (a 160000 gitlink tree entry), clicking that file in the PR's changed-files list fails to open, instead of showing a diff of the submodule commit pointer (old SHA → new SHA).

Error

The editor could not be opened due to an unexpected error. Please consult the log for more details.

From remoteexthost.log (Remote-SSH):

CodeExpectedError: cannot open vscode-remote://ssh-remote+<host>/<path>/<submodule-dir>. Detail: Unable to read file 'vscode-remote://ssh-remote+<host>/<path>/<submodule-dir>' (Error: Unable to read file 'vscode-remote://ssh-remote+<host>/<path>/<submodule-dir>' that is actually a directory)
    at THe.$tryOpenDocument (.../workbench.desktop.main.js:699:10890)

Root cause (from log inspection)

The extension calls vscode.open() on the submodule's literal filesystem path — the same as for a normal changed file — instead of constructing a diff/content-provider URI. Since a submodule tree entry has no blob content of its own (it's a directory containing a nested checkout), the remote file service stats it, finds a directory, and throws EISDIR.

Separately, in another context (opening the same kind of change from the PR description's "Changes" webview), the extension does construct a pr: scheme URI with baseCommit/headCommit/fileName, e.g.:

pr:/<path>?{"baseCommit":"<sha>","headCommit":"<sha>","isBase":false,"fileName":"<submodule-path>","prNumber":<n>,"status":3,"remoteName":"origin"}

but this fails too, with a different error:

CodeExpectedError: cannot open pr:/<path>?{...}. Detail: Could not show object.

So neither code path currently special-cases gitlink (160000) entries — one falls back to opening the raw directory, the other tries to fetch blob content for a commit pointer that has none.

Expected behavior

Clicking a submodule entry in the PR changes view should show a minimal diff of the submodule pointer, e.g.:

Subproject commit <old-sha>
Subproject commit <new-sha>

(similar to git diff output for a submodule, and to how github.com renders it in the PR's "Files changed" tab).

Environment

  • Extension: github.vscode-pull-request-github v0.167.2026092404
  • VS Code Remote - SSH
  • Linux remote host

Related issues

  • #1499 ("We couldn't find commit" when submodules exist) — same underlying gap, different surfaced error
  • #4688 (Add support for git submodules)
主要语言
TypeScript
星标
2.6k
派生
796
平均合并
14 小时 34 分钟
30 天内合并 PR
43

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-pull-request-github 的其他 Issue

查看 microsoft/vscode-pull-request-github 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。