-
Notifications
You must be signed in to change notification settings - Fork 56
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
Relative path in a repo subdirectory not found when using hash symmetric difference #522
Comments
Hi @dshemetov, Could you check whether your description is correct ("not found" in both cases)?
|
Hi @akaihola, thanks for looking into this. It'll take me a little time to remember the context here, but I'll try and verify soon. |
I just managed to reproduce this issue using your repository: [/tmp/darker-test]$ darker --check -r a994113...origin/dev subdir
[/tmp/darker-test]$ darker --check -r a994113...origin/dev subdir/subsubdir
[/tmp/darker-test]$ cd subdir
[/tmp/darker-test/subdir]$ darker --check -r a994113...origin/dev subsubdir
argument PATH: Error: Path(s) 'subsubdir' do not exist in origin/dev |
To reproduce and understand this on the Git level: [/tmp/darker-test]$ git cat-file -p origin/dev:subdir
100644 blob 6f1c2a548639ac49507a525b63597938878b2e6d Makefile
100644 blob 921b47f1f8168d376ad41a120c1d79a4ab8fe5fa requirements.txt
040000 tree adc767417cd500fe67e0add3ca9a71c670ca4b29 subsubdir
[/tmp/darker-test]$ git cat-file -p origin/dev:subdir/subsubdir
100644 blob 14c0d0b5e618b2921fceaee13f4965974d3f137a file.py
[/tmp/darker-test]$ cd subdir
[/tmp/darker-test/subdir]$ git cat-file -p origin/dev:subsubdir
fatal: path 'subsubdir' does not exist in 'origin/dev'
[/tmp/darker/test/subdir]$ git cat-file -p origin/dev:subdir/subsubdir
100644 blob 14c0d0b5e618b2921fceaee13f4965974d3f137a file.py
[/tmp/darker/test/subdir]$ git cat-file -p origin/dev:./subsubdir
100644 blob 14c0d0b5e618b2921fceaee13f4965974d3f137a file.py
[/tmp/darker-test/subdir]$ cd subsubdir
[/tmp/darker-test/subdir/subsubdir]$ git cat-file -p origin/dev:./file.py
a = ["really", "really", "really","really", "really", "really", "really", "really","really", "really", "long", "line"] # add comment So The fix then is to either prepend |
@dshemetov would you like to accept the invite to become a collaborator on the Darker repository, and review the fix in PR #584? |
Hey @akaihola, thanks for addressing this! I see you've already received a review and merged the fix, I will double check and confirm that the issue I had is resolved 👍 |
Glad @dshemetov if it helps! I hope my fix works. Path handling is a bit messy in Darker, could be simplified in the future... |
Describe the bug
Relative path in a repo subdirectory not found when using
--revision=<hash>...<hash>
but not when using--revision=origin/main...
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The behavior between these should be consistent, I believe.
Environment (please complete the following information):
Steps before ready to implement:
The text was updated successfully, but these errors were encountered: