jeresig / pulley

Easy Github Pull Request Lander
MIT License
175 stars 24 forks source link

Support for http remote #58

Closed yocontra closed 10 years ago

yocontra commented 11 years ago

The regex /URL:.*?([\w-]+\/[\w-]+)/ used to get the repo name only works on git@github.com:user/repo and not on https://github.com/user/repo which is also a valid remote.

Changing the regex fixes this

heff commented 11 years ago

The git@ version actually has .git on the end. git@github.com:videojs/video.js.git The regex here wouldn't work for that, since it assume you need up to the end of the line.

Just added #65 which makes it a little more complicated...

heff commented 11 years ago

Well actually, it looks like github adds .git on the end of http remotes too. https://github.com/user/repo.git

I think #65 fixes both issues. You can try this in the console.

/URL:.*?([\w\-]+\/[\w\-\.]+)\.git/.exec('URL: https://github.com/user/repo.git')
> ["URL: https://github.com/user/repo.git", "user/repo"]
robdodson commented 10 years ago

:+1: I just fixed this myself before discovering this ticket :\