Closed sawickil closed 8 years ago
This code is used to escape special characters starting search phrase. These special characters behave differently on Linux and Windows sometines causing no results of search. Also the '-' cause additional problems - when search phrase starts with minus sign searching doesn't return anything because minus is treated as git command switch.
@sawickil Let me know is this info sufficent for you and I will close this issue.
Why is the following code is needed in GitGrepCommand?:
private String escapeSearchPhraseArgument(String wanted) { if (wanted.startsWith("-") || wanted.startsWith(" ") || wanted.startsWith("*")) { return "\" + wanted; } else { return wanted; } }