Remove redundant "which git" guards
There is always a git executable on PATH due to the git wrapper in Library/Contributions/cmd. The wrapper will notify the user if there is not a real git installed.
This commit is contained in:
parent
dae83fc895
commit
44254aa9cf
@ -1,6 +1,5 @@
|
|||||||
require "formula_versions"
|
require "formula_versions"
|
||||||
|
|
||||||
raise "Please `brew install git` first" unless which "git"
|
|
||||||
raise "Please `brew update` first" unless (HOMEBREW_REPOSITORY/".git").directory?
|
raise "Please `brew update` first" unless (HOMEBREW_REPOSITORY/".git").directory?
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def github_fork
|
def github_fork
|
||||||
if which 'git' and (HOMEBREW_REPOSITORY/".git").directory?
|
if (HOMEBREW_REPOSITORY/".git").directory?
|
||||||
if `git remote -v` =~ %r{origin\s+(https?://|git(?:@|://))github.com[:/](.+)/homebrew}
|
if `git remote -v` =~ %r{origin\s+(https?://|git(?:@|://))github.com[:/](.+)/homebrew}
|
||||||
$2
|
$2
|
||||||
end
|
end
|
||||||
|
@ -12,8 +12,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def install_tap user, repo
|
def install_tap user, repo
|
||||||
raise "brew install git" unless which 'git'
|
|
||||||
|
|
||||||
# we special case homebrew so users don't have to shift in a terminal
|
# we special case homebrew so users don't have to shift in a terminal
|
||||||
repouser = if user == "homebrew" then "Homebrew" else user end
|
repouser = if user == "homebrew" then "Homebrew" else user end
|
||||||
user = "homebrew" if user == "Homebrew"
|
user = "homebrew" if user == "Homebrew"
|
||||||
|
@ -9,7 +9,6 @@ module Homebrew
|
|||||||
Use `brew upgrade <formula>`.
|
Use `brew upgrade <formula>`.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
abort "Please `brew install git' first." unless which "git"
|
|
||||||
|
|
||||||
# ensure GIT_CONFIG is unset as we need to operate on .git/config
|
# ensure GIT_CONFIG is unset as we need to operate on .git/config
|
||||||
ENV.delete('GIT_CONFIG')
|
ENV.delete('GIT_CONFIG')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user