Fix push not allowed to protected branch if  commit starts with 7 zeros.

Fix https://github.com/gitlabhq/gitlabhq/issues/8232

This fix works because the function is only called by the `internal` API, which gets refs from git pre-receive-hook from gitlab shell, which always sends full SHA-1s to the stdin.

There are many other such similar problems on the APP where short `0` strings are tested for: there is even a `'0' * 5`, which exists in the gitlab repo: only 40 zeroes should be used everywhere: this SHA1 has not been inversed so far and would break Git: http://stackoverflow.com/questions/1902340/can-a-sha-1-hash-be-all-zeroes