yu55 / yagga

Yet Another Git Grep Application - simple web application that allows you to git grep over many repositories via web interface.
https://github.com/yu55/yagga
MIT License
2 stars 4 forks source link

Question - What is that code for? #32

Closed sawickil closed 8 years ago

sawickil commented 8 years ago

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; } }

yu55 commented 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.

yu55 commented 8 years ago

@sawickil Let me know is this info sufficent for you and I will close this issue.