Make the project compilable when it's added as a git submodule
Make the project compilable when it's added as a git submodule

The previous gitBranch() function only search '$rootDir/.git/HEAD' file.
But, when the project is added as a git sub module, the '$rootDir/.git'
is a file, not a directory. The file stores the module git repository
directory. So the change is to help finding the submodule local git
repository.

Signed-off-by: Zhang Wei <d6fa6f3f4186ada68220f9e69e7ddc7f2c936bdf@lambdacloud.com>
(cherry picked from commit 799b1c403b5ced1db28a893e0dfb555cb646936a)

girirajsharma/elasticsearch-hadoop,elastic/elasticsearch-hadoop,takezoe/elasticsearch-hadoop,xjrk58/elasticsearch-hadoop,costin/elasticsearch-hadoop,elastic/elasticsearch-hadoop