Permalink
Browse files

Merge branch 'git-config--stop-setting-global'

  • Loading branch information...
2 parents d5d36ce + 7cdd08e commit 67ca80b644484f375e9f48fd83d6eb11a585cf31 @davidrans davidrans committed Feb 28, 2017
Showing with 6 additions and 9 deletions.
  1. +6 −9 lib/github.rb
View
@@ -7,16 +7,13 @@
module Github
##
- # Get a global git config property
+ # Get a git config property from the first place that defines it. The `git
+ # config` command takes properties, by default, from the repository, the
+ # user's config, and the system config, in that order. We used to specify
+ # `--global` here, but that means to read _only_ from the global config, and
+ # it also prohibits processing includes by default.
##
def self.config(property)
- `git config --global #{property.to_s.shellescape}`.strip
- end
-
- ##
- # Get a local (to the repo) git config property
- ##
- def self.local_config(property)
`git config #{property.to_s.shellescape}`.strip
end
@@ -93,7 +90,7 @@ def self.request_authorization(authorization_info)
# Requires the "origin" remote to be set to a github url
##
def self.get_github_repo()
- url = self::local_config("remote.origin.url")
+ url = self::config("remote.origin.url")
m = /github\.com.(.*?)\/(.*)/.match(url)
if m
return [m[1], m[2].sub(/\.git\Z/, "")].join("/")

0 comments on commit 67ca80b

Please sign in to comment.