Fixes get repository name method.

Some remotes don't include the .git extension
so it changes the repo name regexp and adds an
optional regexp for the .git extension
Merge pull request #4 from kandalf/master

Fixes get repository name method.