From 90628479f588ba2b8458f4df541d0a0d05a73e1b Mon Sep 17 00:00:00 2001 From: Stephen Touset Date: Sun, 8 Aug 2010 22:07:16 -0700 Subject: [PATCH] Bugfix: Don't assume ".git" on end of git URLs --- lib/hub/context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hub/context.rb b/lib/hub/context.rb index c583d28a..8b226ed8 100644 --- a/lib/hub/context.rb +++ b/lib/hub/context.rb @@ -12,7 +12,7 @@ module Hub REMOTES = Hash.new do |cache, remote| url = GIT_CONFIG["config remote.#{remote}.url"] - if url && url.to_s =~ %r{\bgithub\.com[:/](.+)/(.+).git$} + if url && url.to_s =~ %r{\bgithub\.com[:/](.+)/(.+?)(.git)?$} cache[remote] = { :user => $1, :repo => $2 } else cache[remote] = { } -- GitLab