-
Notifications
You must be signed in to change notification settings - Fork 13
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
dulwich: use untracked_files="no" in is_dirty #74
dulwich: use untracked_files="no" in is_dirty #74
Conversation
ee82286
to
9bab422
Compare
Was this tested with dvc? |
Not yet, why? |
@dtrifiro Well, it is not good if it will break dvc tests 😄 Let's not release this until it is tested. |
😅 indeed, although it does not change existing behaviour. Running tests right now |
No tests fail when running locally: Works on my machine® Currently running some CI tests here with |
9bab422
to
9dc1ceb
Compare
9dc1ceb
to
14bf052
Compare
14bf052
to
9befe4f
Compare
7d249e2
to
b4d489f
Compare
staged, unstaged, untracked = self.status(**kwargs) | ||
return bool(staged or unstaged or untracked) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any
makes the intention more clearer.
staged, unstaged, untracked = self.status(**kwargs) | |
return bool(staged or unstaged or untracked) | |
staged, unstaged, untracked = self.status(**kwargs) | |
return any((staged, unstaged, untracked)) |
You can further simplify this to just:
staged, unstaged, untracked = self.status(**kwargs) | |
return bool(staged or unstaged or untracked) | |
return any(self.status(**kwargs)) |
tests/test_git.py
Outdated
with (tmp_dir / "foo").open("a") as fobj: | ||
fobj.write("modified") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency,
with (tmp_dir / "foo").open("a") as fobj: | |
fobj.write("modified") | |
tmp_dir.gen("foo", "modified") |
tests/test_git.py
Outdated
|
||
@pytest.mark.skip_git_backend("pygit2") | ||
@pytest.mark.parametrize("untracked_files", [False, True]) | ||
def test_is_dirty( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll suggest splitting this test into 2 tests:
- test for untracked
- test for modify-then-commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up getting rid of the parametrization and adding more tests for is_dirty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to split these blocks into individual tests if possible.
b4d489f
to
4bebc0f
Compare
This will speed up calling `is_dirty` with untracked_files=False related to iterative#69
4bebc0f
to
fe3aa26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙂
@pmrowla Could you take a final look as well, please? |
This will speed up calling
is_dirty
whenuntracked_files=False
related to #69