Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

porcelain's status/get_untracked_paths fails to return untracked files in the top level of the git #1247

Open
rmspeers opened this issue Jan 2, 2024 · 0 comments

Comments

@rmspeers
Copy link

rmspeers commented Jan 2, 2024

The porcelain status function and the get_untracked_paths function that it calls do not return new untracked files that are in the repo's top level. Unit tests only check that this works in the nested directories, checks on the top level are not implemented with asserts.

https://github.com/jelmer/dulwich/blob/master/dulwich/porcelain.py#L1374

file_path = r.path / "sample.txt"
file_path.write_text("top level")
list(porcelain.get_untracked_paths(repo.path, repo.path, repo.open_index(), exclude_ignored=False, untracked_files="all"))
[]
# NOTE THE ABOVE SHOULD SHOW sample.txt!!!
Path(repo.path/"tempdir").mkdir()
dfile_path.write_text("nested")
list(porcelain.get_untracked_paths(repo.path, repo.path, repo.open_index(), exclude_ignored=False, untracked_files="all"))
['tempdir/sample.txt']

The status function calls into this get_untracked_paths the same way and thus has the same behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant