You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Status() reports a wholly untracked directory as a plain file path, so callers can't tell "newdir/" from a file named "newdir" #150
The default untracked mode is GitUntrackedFilesMode.Normal. In that mode, git collapses a directory with no tracked files to a single record, ? newdir/, with a trailing slash. The collapse itself is documented on the enum.
However, Parsing/GitStatusParser.cs (ReadPathOnlyEntry, around lines 76 and 220) converts the path with GitParseValues.ToRelativeFilePath, which loses the trailing /. GitStatusEntry has no directory flag either. The entry is typed as a RelativeFilePath, and nothing indicates that it is a directory. Ignored (!) records have the same problem.
Failure scenario
Commit a.txt, then create newdir/x.txt. Status() returns a single entry: Path='newdir', Untracked. That is exactly what an untracked file named newdir would produce.
A "discard untracked files" feature that calls File.Delete(entry.Path) throws or does nothing.
A UI can't show a folder or offer to expand it.
An untracked nested repository or submodule checkout shows up the same way.
This was reproduced with a scratch integration test through the public Status() API, which printed STATUS 'newdir' Untracked.
Suggested fix / acceptance criteria
Detect the trailing / on ? and ! records and surface it, for example with bool IsDirectory on GitStatusEntry, or with a directory-path type.
Tests:
in default mode, Status() over an untracked directory reports an entry marked as a directory;
an untracked file with the same name is not marked as a directory.
Category: Bug (it is labelled enhancement, but this is a status report that loses information)
Priority: Medium. In the default untracked mode, an untracked directory can't be told apart from a file of the same name. A consumer that discards untracked entries with File.Delete, or that renders a tree, gets it wrong.
Area / suggested assignment: Status parsing: Parsing/GitStatusParser.ReadPathOnlyEntry, Models/GitStatusEntry. @matt-edmondson
Notes: An additive bool IsDirectory on GitStatusEntry keeps the change non-breaking. Apply it to both ? and ! records, and cover an untracked nested repository in the tests too.
Activity
matt-edmondson commentedon Sep 28, 2026
Triage
enhancement, but this is a status report that loses information)File.Delete, or that renders a tree, gets it wrong.Parsing/GitStatusParser.ReadPathOnlyEntry,Models/GitStatusEntry. @matt-edmondson<,>or|, or is longer than 256 characters (legal on Linux/macOS) #131 and Worktrees() reports the wrong path for a worktree whose path contains a newline, and returns lock/prunable reasons still C-quoted #141 are other status and path-parsing bugs, with different causes.Unstageonly.Notes: An additive
bool IsDirectoryonGitStatusEntrykeeps the change non-breaking. Apply it to both?and!records, and cover an untracked nested repository in the tests too.Generated by Claude Code