[git] IDEA-128461 Don't read branch info from hidden files
[vcs] Throw IAE if not a hash is passed to HashImpl constructor

NumberFormatException is not thrown anymore, since Integer.parseInt()
was changed to Character.digit().
digit() returns -1 instead of throwing an exception which may lead to
incorrect Hash objects if not a hash string is passed. Better to
throw an exception in that case.

(cherry picked from commit 2c71bdf5c43ce0596dd282e17aaf20ee93528741)