Fix CliGitAPIImpl.getHeadRev bug - returned same SHA1 for all refs

The getHeadRev(url) implementation in CliGitAPIImpl returned the same
SHA1 for all refs, even though the refs had different SHA1 values in
the output.