aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorlukas2010-07-27 17:44:43 +0200
committerAdam Vandenberg2010-08-07 22:22:15 -0700
commitdf65d5bc45c1961166608a457cfe4df19f59c8ec (patch)
tree5c49431f4f81499d7f3d5baa9be9740246b77936 /Library
parent9313c3ce0dd35752b3018b12a071c8ed2f9da7d1 (diff)
downloadhomebrew-df65d5bc45c1961166608a457cfe4df19f59c8ec.tar.bz2
change behaviour of github_info to fallback sooner to mxcl/master
Fixes #1980 Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 185347123..ba3c15f05 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -156,18 +156,17 @@ end
def github_info name
formula_name = Formula.path(name).basename
- user = ''
- branch = ''
+ user = 'mxcl'
+ branch = 'master'
if system "/usr/bin/which -s git"
- user=`git config --global github.user`.chomp
- all_branches = `git branch 2>/dev/null`
- /^\*\s*(.*)/.match all_branches
- branch = ($1 || '').chomp
+ gh_user=`git config --global github.user 2>/dev/null`.chomp
+ /^\*\s*(.*)/.match(`git --work-tree=#{HOMEBREW_REPOSITORY} branch 2>/dev/null`)
+ unless $1.nil? || $1.empty? || gh_user.empty?
+ branch = $1.chomp
+ user = gh_user
+ end
end
-
- user = 'mxcl' if user.empty?
- branch = 'master' if branch.empty?
return "http://github.com/#{user}/homebrew/commits/#{branch}/Library/Formula/#{formula_name}"
end