[Bug] 已忽略或排除的目录中,子仓库仍出现在 Git 面板

Open
#1,657 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lin-coco is already working on this.

Since Nov 2, 2026.

  • #1659 by @lin-coco — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, typescript
Domain
devtools

Research direction

The payload names no repository files, so start from the Git root auto-discovery path that walks the project tree and decides which nested repositories to add to the Git panel. Check whether it consults .gitignore or the manual-exclusion state before registering a child repo. Done when nested repos under ignored or excluded directories stay out of discovery, while explicitly opened repos, real submodules and the parent repo's own changes are unaffected. The linked IntelliJ VcsRootScanner is the reference design.

Written by the indexing model from the issue text.

Description

review: medium
Platform / 平台

macOS

Area / 模块

Git

Lithe version / Lithe 版本

最新 AutoBuild:0.3.0,Build 20261102.105732,源码 8b1d666933cc4250c04770fcd755073bfd07c447(构建时间:2026-11-02 18:57:32,UTC+8)。

本轮修复和源码验证基于该 AutoBuild 源码;截图来自本地 Lithe-Dev 开发构建。

Priority / 优先级

P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用

OS and architecture / 操作系统与架构

本次截图环境:macOS 27.2,arm64。故障现场的完整系统 build 未留存。

Environment / 环境信息

本地父仓库中包含独立子仓库。父目录被 .gitignore 忽略,或在 Lithe 中标为手动排除。问题不依赖特定编程语言;故障现场的 Git 版本未采集。Windows 已同步实现,原生界面尚未验收。

Steps to reproduce / 复现步骤
  1. 在父项目的 test 目录下创建两个独立 Git 仓库,并分别准备本地改动。
  2. 将 test/ 加入父仓库 .gitignore;另一个场景是只将 test 手动标为排除。
  3. 打开父项目并刷新 Commit、分支和 Git Log,检查这两个子仓库是否仍被自动纳入。
Expected behavior / 预期行为

忽略或排除目录内的普通子仓库不再自动纳入。显式打开的仓库和真实子模块仍可管理;父仓库原本可提交的文件不受影响。

Actual behavior / 实际行为

修复前,自动发现会进入这些目录,将里面的独立子仓库加入 Git 面板。仅在项目树显示排除状态,并未让 Git 自动发现停止扫描。

设计与实现参考 IntelliJ IDEA 社区版的 VcsRootScanner和VcsRootErrorsHandler:扫描遵循目录策略,自动注册过滤 Git 忽略或项目排除路径。这里对齐自动发现规则,未新增完整的 VCS 映射管理。

相关 #1064 已处理隐藏缓存目录;本报告补齐 Git 忽略和手动排除的场景。

Logs or diagnostic output / 日志或诊断输出
修复前运行日志未留存。
已有隔离验收记录:忽略/手动排除的子仓库不再自动纳入,
可见仓库和父仓库改动保留,显式打开被忽略仓库后仍可管理。
Screenshots or recordings / 截图或录屏

修复后的 Lithe-Dev 局部截图。test 内含两个独立 Git 仓库,且当前同时被 Git 忽略和手动排除;刷新提交面板后没有纳入它们,仍显示父仓库的四项改动。这组图不单独证明两种规则分别生效;分别验证见已有隔离验收记录。

被排除的目录和子仓库

刷新后的提交列表及忽略规则

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
12h 6m
Merged PRs (30d)
365

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.