Treat possible commit as partial hash as fallback.
Shorter and less condition
Merge pull request #1 from bawaaaaah/patch-1

remove unecessary condition
Make the code PSR-2-compliant.
Merge pull request #456 from mikedld/support-partial-commit-hash

Treat possible commit as partial hash as fallback.