Fix detection of git repositories to not look for trash inside them

The intent was to not look for trash inside git repositories but it did
not work. It was looking for a file called HEAD inside a folder name
ending with .git but the check was done in the visitFile method of the
SimpleVisitor which is too late. The git repository is already partially
visited by the time the HEAD file is processed.

To skip the git repositories, the check must be done before starting to
visit the folder. Move the check in the preVisitDirectory method.

Replace the logic of looking a file named HEAD inside a folder name
ending with .git by the jgit FileKey.isGitRepository method.

Change-Id: Ib673d8e9e787c09ef2c7a901d8c2b2c795559ede
1 file changed
tree: 17c666233db75c645d8eb60c5e36a5b01a82a398
  1. src/
  2. .gitignore
  3. BUCK
  4. pom.xml