Improve global search: Add diffing from results with query highlighting
Users can now open a diff for a specific search hit directly from the global search results. The original search query will be highlighted within the diff view, making it easier to locate the relevant changes. Additionally, add `--no-textconv` to git commands used in search and diff operations. This prevents failures when git encounters binary files that textconv drivers might otherwise attempt to process.
This commit is contained in:
@@ -1338,6 +1338,10 @@ fn search_candidate_commits(
|
||||
OsString::from("--all"),
|
||||
OsString::from("--reverse"),
|
||||
OsString::from("--format=%H"),
|
||||
// Skip textconv diff drivers so git does not extract binary files
|
||||
// (e.g. .docx / Office temp "~$" lock files) to temp files, which can
|
||||
// fail with "unsupported filetype" and abort the whole search.
|
||||
OsString::from("--no-textconv"),
|
||||
];
|
||||
if !case_sensitive {
|
||||
args.push(OsString::from("-i"));
|
||||
@@ -1447,7 +1451,7 @@ fn first_added_match_line(
|
||||
check_search_cancelled(cancellation)?;
|
||||
let output = run_git_with_paths_cancellable(
|
||||
repo,
|
||||
&["diff", "--unified=0", parent, commit],
|
||||
&["diff", "--no-textconv", "--unified=0", parent, commit],
|
||||
&[file.to_string()],
|
||||
cancellation,
|
||||
"Git-Diff fuer Suchtreffer fehlgeschlagen",
|
||||
|
||||
Reference in New Issue
Block a user