Skip to content
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

[BUG] dotbare fcheckout -s preview would break if selected files contain spaces #14

Open
kazhala opened this issue Jul 1, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@kazhala
Copy link
Owner

kazhala commented Jul 1, 2020

In v1.2.0, I added support for staging files with spaces. Most of them are handled through bash array with something like ${array[@]} to respect spaces between indexes. All of them works very well with git commands, however, for some reason, git diff just doesn't like ${array[@]} and this breaks the preview for dotbare fcheckout -s If I do try it I get an error. Well if I do use ${array[*]}, git diff is happy, however, preview for files containing spaces would break due to the asterisk does not respect spaces any more.

Note: This doesn't affect any actual functionalities of dotbare, it's just preview that's breaking.
I'm quite stuck on this, although this won't affect any functionalities and it's unlikely for anyone to experience this, I'll just leave this one here.

Relevant lines:

| fzf --no-multi --header="${header}" --preview "echo {} \
| awk '{print \$1}' \
| xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \
diff --color=always __ ${files[*]}" \

This works for normal files but not files with spaces. If I do change it to ${files[@]}, none of them will work.

@kazhala kazhala added the bug Something isn't working label Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant