Skip to content

🐛 Panic running git grep through delta pager when txt file contains © #1448

Description

@bdukes

With pager = delta in my .gitconfig, while running git grep and the results include a line with a © symbol in a License.txt file, the results start to display, but there's a panic when the line with the © symbol is supposed to be displayed.

For this specific example, I'm in https://github.com/dnnsoftware/Dnn.Platform, running git grep SharpZipLib from the DNN Platform/Components/SharpZipLib directory (I actually ran the command from the root directory, but narrowed it down to reduce the amount of extra results for the issue).

It renders without issue in a diff and when using less as the pager directly (though the © symbol renders as <A9> via less).

> git grep SharpZipLib

thread 'main' panicked at 'byte index 57 is not a char boundary; it is inside '�' (bytes 56..59) of License.txt:1:Copyright � 2000-2018 SharpZipLib Contributors', src\handlers\grep.rs:381:64
stack backtrace:
0x7ff6d8c2d422 - git_filter_source_path
1: 0x7ff6d8c4dd8b - git_filter_source_path
2: 0x7ff6d8c2827a - git_filter_source_path
3: 0x7ff6d8c2d16b - git_filter_source_path
4: 0x7ff6d8c2ff0a - git_filter_source_path
5: 0x7ff6d8c2fb70 - git_filter_source_path
6: 0x7ff6d8c305e6 - git_filter_source_path
7: 0x7ff6d8c304de - git_filter_source_path
8: 0x7ff6d8c2e0c9 - git_filter_source_path
9: 0x7ff6d8c301f0 - git_filter_source_path
10: 0x7ff6d8d64a15 - onig_unicode_define_user_property
11: 0x7ff6d8c517e2 - git_filter_source_path
12: 0x7ff6d8d650a3 - onig_unicode_define_user_property
13: 0x7ff6d8a348ab -
14: 0x7ff6d8aacbee -
15: 0x7ff6d8aa520e -
16: 0x7ff6d8a6b01b -
17: 0x7ff6d8ac7016 -
18: 0x7ff6d8ac7eec -
19: 0x7ff6d8c20e0e - git_filter_source_path
20: 0x7ff6d8a6c27c -
21: 0x7ff6d8d55e8c - onig_unicode_define_user_property
22: 0x7ffe8f2826ad - BaseThreadInitThunk
23: 0x7ffe903aa9f8 - RtlUserThreadStart
License.txt:

> git --no-pager grep SharpZipLib

License.txt:1:Copyright © 2000-2018 SharpZipLib Contributors
SharpZipLib.dnn:3:
SharpZipLib.dnn:4: SharpZipLib
SharpZipLib.dnn:14: https://github.com/icsharpcode/SharpZipLib/wiki/Release-History
SharpZipLib.dnn:20: ICSharpCode.SharpZipLib.dll

I'm running this on Windows 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions