lib/travis/cli/repo_command.rb in travis-1.1.3 vs lib/travis/cli/repo_command.rb in travis-1.2.0
- old
+ new
@@ -1,11 +1,11 @@
require 'travis/cli'
module Travis
module CLI
class RepoCommand < ApiCommand
- GIT_REGEX = %r{Fetch URL: (?:https://|git://|git@)github\.com[:/](.*/.+?)(\.git)?$}
+ GIT_REGEX = %r{^(?:https://|git://|git@)github\.com[:/](.*/.+?)(\.git)?$}
on('-r', '--repo SLUG') { |c, slug| c.slug = slug }
attr_accessor :slug
abstract
@@ -41,10 +41,10 @@
def detected_endpoint?
!explicit_api_endpoint?
end
def find_slug
- git_info = `git remote show origin 2>&1`
+ git_info = `git config --get remote.origin.url 2>&1`
$1 if git_info =~ GIT_REGEX
end
def repo_config
config['repos'] ||= {}