git2-rs
git2-rs copied to clipboard
Fix revparsing with windows paths in blame example
revparse_single uses a git object name and not a file path - that means backslashes must be translated to slashes on windows.
Otherwise the example fails:
E:\dev\git2-rs>.\target\debug\blame.exe examples\blame.rs
error: the path 'examples\blame.rs' does not exist in the given tree; class=Tree (14); code=NotFound (-3)
I reused the cfg! conditional from remote.rs, but there might be a better way to do that.