lib/travis/cli/repo_command.rb in travis-1.2.2 vs lib/travis/cli/repo_command.rb in travis-1.2.3
- old
+ new
@@ -41,10 +41,14 @@
def detected_endpoint?
!explicit_api_endpoint?
end
def find_slug
- git_info = `git config --get remote.origin.url 2>&1`
+ git_head = `git name-rev --name-only HEAD 2>&1`.chomp
+ git_remote = `git config --get branch.#{git_head}.remote 2>&1`.chomp
+ # Default to 'origin' if no tracking is set
+ git_remote = 'origin' if git_remote.empty?
+ git_info = `git config --get remote.#{git_remote}.url 2>&1`.chomp
$1 if git_info =~ GIT_REGEX
end
def repo_config
config['repos'] ||= {}