Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
a39aae88
Unverified
Commit
a39aae88
authored
4 years ago
by
Markus Reiter
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8496 from reitermarkus/debug-git
Properly fix Git error in tests.
parents
747223e2
01292473
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/test/utils/git_spec.rb
+8
-1
8 additions, 1 deletion
Library/Homebrew/test/utils/git_spec.rb
Library/Homebrew/utils/git.rb
+6
-7
6 additions, 7 deletions
Library/Homebrew/utils/git.rb
with
14 additions
and
8 deletions
Library/Homebrew/test/utils/git_spec.rb
+
8
−
1
View file @
a39aae88
...
@@ -3,9 +3,14 @@
...
@@ -3,9 +3,14 @@
require
"utils/git"
require
"utils/git"
describe
Utils
::
Git
do
describe
Utils
::
Git
do
before
do
around
do
|
example
|
described_class
.
clear_available_cache
example
.
run
ensure
described_class
.
clear_available_cache
described_class
.
clear_available_cache
end
before
do
git
=
HOMEBREW_SHIMS_PATH
/
"scm/git"
git
=
HOMEBREW_SHIMS_PATH
/
"scm/git"
HOMEBREW_CACHE
.
cd
do
HOMEBREW_CACHE
.
cd
do
...
@@ -145,6 +150,8 @@ describe Utils::Git do
...
@@ -145,6 +150,8 @@ describe Utils::Git do
end
end
it
"installs git"
do
it
"installs git"
do
skip
if
ENV
[
"HOMEBREW_TEST_GENERIC_OS"
]
expect
(
described_class
).
to
receive
(
:available?
).
and_return
(
false
)
expect
(
described_class
).
to
receive
(
:available?
).
and_return
(
false
)
expect
(
described_class
).
to
receive
(
:safe_system
).
with
(
HOMEBREW_BREW_FILE
,
"install"
,
"git"
).
and_return
(
true
)
expect
(
described_class
).
to
receive
(
:safe_system
).
with
(
HOMEBREW_BREW_FILE
,
"install"
,
"git"
).
and_return
(
true
)
expect
(
described_class
).
to
receive
(
:available?
).
and_return
(
true
)
expect
(
described_class
).
to
receive
(
:available?
).
and_return
(
true
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/utils/git.rb
+
6
−
7
View file @
a39aae88
...
@@ -94,13 +94,12 @@ module Utils
...
@@ -94,13 +94,12 @@ module Utils
begin
begin
oh1
"Installing
#{
Formatter
.
identifier
(
"git"
)
}
"
oh1
"Installing
#{
Formatter
.
identifier
(
"git"
)
}
"
# We need to unset `HOMEBREW_TEST_GENERIC_OS`, otherwise `git` will be
# Otherwise `git` will be installed from source in tests that need it. This is slow
# installed from source in tests that need it. This is slow and will
# and will also likely fail due to `OS::Linux` and `OS::Mac` being undefined.
# also likely fail due to `OS::Linux` and `OS::Mac` being undefined.
raise
"Refusing to install Git on a generic OS."
if
ENV
[
"HOMEBREW_TEST_GENERIC_OS"
]
with_env
"HOMEBREW_TEST_GENERIC_OS"
=>
nil
do
safe_system
HOMEBREW_BREW_FILE
,
"install"
,
"git"
safe_system
HOMEBREW_BREW_FILE
,
"install"
,
"git"
clear_available_cache
clear_available_cache
end
rescue
rescue
raise
"Git is unavailable"
raise
"Git is unavailable"
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment