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

fix windows path handling in blame view #791

Closed
wants to merge 1 commit into from

Conversation

enizor
Copy link

@enizor enizor commented Jun 16, 2021

revparse_single uses a git object name and not a file path - that means backslashes must be translated to slashes on windows.
Otherwise the blame view fails:

┌Blame -- src\main.rs -- <no blame available>

I reused the cfg! conditional from git2-rs/src/remote.rs, but there might be a better way to do that.

Resulting blame view on windows:

 Blame -- src\main.rs -- 869e4b7───────────────────────────────────────────────────────────────┐
 │f8f05d6 2020-03-31 Stephan Dilly          0│ #![forbid(unsafe_code)]                         │

@enizor
Copy link
Author

enizor commented Jun 16, 2021

The bug probably got introduced by #762 😅 I should have checked more thoroughly

@extrawurst
Copy link
Owner

we should probably refactor blame_file to take a Path (which automatically handles the separators) as a more sustainable solution

@extrawurst
Copy link
Owner

@enizor let me know if you need more help to bring this to the finish line. for the time being I mark this PR as draft, let me know when you think its ready

@enizor
Copy link
Author

enizor commented Nov 12, 2021

fixed by #984

@enizor enizor deleted the fix-windows-blame branch November 12, 2021 15:08
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

Successfully merging this pull request may close these issues.

2 participants