Skip to content

Worktree.Status() ignores changes to previously checked in files in gitignore #718

@cbbm142

Description

@cbbm142

If someone checks in a file and then it is added to gitignore, git status will show it as modified

git status
On branch main

Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: checkedinbeforeignored/somefile.txt

no changes added to commit (use "git add" and/or "git commit -a")`

Worktree.Status() ignores this change and subsequently IsClean() will return true, even though the native git client shows the change. I have made an example you can test this on here. If you clone it and modify checkedinbeforeignored/somefile.txt, native git status will show it modified, while Worktree.Status() does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions