-
Notifications
You must be signed in to change notification settings - Fork 87
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
[Search git status] fix extra quotes around paths with space #230
Conversation
@@ -1,5 +1,6 @@ | |||
set --global --export SHELL /bin/sh | |||
# don't set FZF_DEFAULT_OPTS so it will set one | |||
# erase FZF_DEFAULT_OPTS so that one will be set by the wrapper function | |||
set --erase FZF_DEFAULT_OPTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of scope change to facilitate local tests where I do have a FZF_DEFAULT_OPTS set already
@@ -25,7 +25,7 @@ function _fzf_search_git_status --description "Search the output of git status. | |||
end | |||
end | |||
|
|||
commandline --current-token --replace -- (string escape -- $cleaned_paths | string join ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out string escape
is unnecessary because git status already escapes filenames with spaces in them
@@ -1,10 +1,11 @@ | |||
set files "filename_with_*.txt" "filename with space.csv" | |||
set files "filename_with_*.txt" "filename with space.csv" tests/_resources/nestedfilename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated test to also test it works for nested filenames
This fixes a bug where file paths outputted by search git status include an extra layer of single quotes if the path includes a space. Turns out this is because we string escape all our paths before writing them to the command line but git status already string escapes paths with spaces.
Fixes #220