-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search git status] Fix previewing paths with spaces
Previously, paths containing spaces broke the preview. Turns out the qutoes added by git status for paths containing spaces were being passed literally to git diff as part of the path and thus git diff could not find the file.
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set path_with_space "tests/_resources/multi word dir/file 1.txt" | ||
set expected_diff a-very-unique-line | ||
echo $expected_diff >>$path_with_space | ||
set output (_fzf_preview_changed_file " M \"$path_with_space\"") | ||
|
||
string match --entire --quiet $expected_diff $output | ||
@test "git diff successfully invoked on path with space" $status -eq 0 | ||
|
||
git restore $path_with_space |