Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Git panel shows empty diffs and Discard fails when the project is a subfolder of a repository

クローズ
#174 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, typescript
領域
desktop, devtools

調査の方向性

Start in src/main/panels/git.ts and trace how diff, discard, ownPath, and countLines handle paths from git status --porcelain. Check the existing tests and add coverage for a project in a repository subfolder, including tracked and untracked files. Done means diffs, discard, line counts, and commit scope work correctly for that project without including sibling-package files.

索引モデルが issue の本文から書いたものです。

説明

bug priority: medium severity: medium

Found in the 2026-10-07 code review and confirmed with git in a scratch repository.

Problem

git status --porcelain paths are relative to the repository root. src/main/panels/git.ts (diff, discard, ownPath, countLines) treats them as relative to the project folder. isRepo() accepts an enclosing repository, and #132 supports projects inside another repo on purpose. In repo/pkg, status lists pkg/f.txt. git diff HEAD -- :(literal)pkg/f.txt prints nothing, and git checkout HEAD -- :(literal)pkg/f.txt fails with "pathspec did not match".

Impact

In a monorepo package:

  • Selecting a file shows "No textual changes".
  • Discard fails for tracked files, and silently does nothing for untracked ones (it resolves pkg/pkg/new.txt).
  • Discard All aborts partway through.
  • Untracked files get no line counts.
  • Files from sibling packages are listed, and Commit includes them.

Fix

Run path operations with -C <toplevel> and :(top,literal) pathspecs, mapping paths through git rev-parse --show-prefix. Or limit status to the project (git status -- .). Add tests that use a project in a subfolder of a repo.

主要言語
TypeScript
スター
2
フォーク
2
平均マージ
6時間 27分
マージ済み PR(30日)
37

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PierrunoYT/patch のほかの issue

PierrunoYT/patch の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。