dotbare icon indicating copy to clipboard operation
dotbare copied to clipboard

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

Open kazhala opened this issue 4 years ago • 0 comments

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: https://github.com/kazhala/dotbare/blob/3e5838f727e9ef78b50b67231dc79d41c765e208/helper/git_query.sh#L32-L35

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

kazhala avatar Jul 01 '20 08:07 kazhala