Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
4ab76e80
Commit
4ab76e80
authored
Oct 18, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that git 1.7.5 or newer is installed
Fixes #2651
parent
70ee408b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
command.rb
lib/cocoapods/command.rb
+15
-0
command_spec.rb
spec/functional/command_spec.rb
+10
-0
No files found.
CHANGELOG.md
View file @
4ab76e80
...
@@ -49,6 +49,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -49,6 +49,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Kyle Fuller
](
https://github.com/kylef
)
[
Kyle Fuller
](
https://github.com/kylef
)
[
#2083
](
https://github.com/CocoaPods/CocoaPods/issues/2083
)
[
#2083
](
https://github.com/CocoaPods/CocoaPods/issues/2083
)
*
Ensure that git 1.7.5 or newer is installed when running pod.
[
Kyle Fuller
](
https://github.com/kylef
)
[
#2651
](
https://github.com/CocoaPods/CocoaPods/issues/2651
)
## 0.34.2
## 0.34.2
...
...
lib/cocoapods/command.rb
View file @
4ab76e80
...
@@ -42,6 +42,8 @@ module Pod
...
@@ -42,6 +42,8 @@ module Pod
def
self
.
run
(
argv
)
def
self
.
run
(
argv
)
help!
'You cannot run CocoaPods as root.'
if
Process
.
uid
==
0
help!
'You cannot run CocoaPods as root.'
if
Process
.
uid
==
0
verify_git_version!
super
(
argv
)
super
(
argv
)
UI
.
print_warnings
UI
.
print_warnings
end
end
...
@@ -111,5 +113,18 @@ module Pod
...
@@ -111,5 +113,18 @@ module Pod
raise
Informative
,
"No `Podfile.lock' found in the project directory, run `pod install'."
raise
Informative
,
"No `Podfile.lock' found in the project directory, run `pod install'."
end
end
end
end
def
self
.
verify_git_version!
begin
git_version
=
`git version`
.
strip
rescue
Errno
::
ENOENT
help!
'CocoaPods requires you to have `git` installed.'
end
git_version
=
Version
.
new
(
git_version
.
split
[
2
])
if
git_version
<
Pod
::
Version
.
new
(
'1.7.5'
)
help!
'CocoaPods requires git version 1.7.5 or newer. Please update git.'
end
end
end
end
end
end
spec/functional/command_spec.rb
View file @
4ab76e80
...
@@ -17,5 +17,15 @@ module Pod
...
@@ -17,5 +17,15 @@ module Pod
Process
.
stubs
(
:uid
).
returns
(
0
)
Process
.
stubs
(
:uid
).
returns
(
0
)
lambda
{
Pod
::
Command
.
run
([
'--version'
])
}.
should
.
raise
CLAide
::
Help
lambda
{
Pod
::
Command
.
run
([
'--version'
])
}.
should
.
raise
CLAide
::
Help
end
end
it
"doesn't let you run without git installed"
do
Pod
::
Command
.
expects
(
:`
).
with
(
'git version'
).
raises
(
Errno
::
ENOENT
)
lambda
{
Pod
::
Command
.
run
([
'--version'
])
}.
should
.
raise
CLAide
::
Help
end
it
"doesn't let you run with git version < 1.7.5"
do
Pod
::
Command
.
expects
(
:`
).
with
(
'git version'
).
returns
(
'git version 1.7.4.1 (Apple Git-50)'
)
lambda
{
Pod
::
Command
.
run
([
'--version'
])
}.
should
.
raise
CLAide
::
Help
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment