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
9e71add2
Commit
9e71add2
authored
Nov 16, 2013
by
Joshua Kalpin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1595 from Kapin/unreachable-repo-fix
[SourcesManager] Ignore repos with unreachable sources on update
parents
a6a9f9ed
0feb5f1d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
CHANGELOG.md
CHANGELOG.md
+7
-0
sources_manager.rb
lib/cocoapods/sources_manager.rb
+16
-4
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+5
-0
No files found.
CHANGELOG.md
View file @
9e71add2
...
@@ -17,6 +17,13 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -17,6 +17,13 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Kevin Wales
](
https://github.com/kwales
)
[
Kevin Wales
](
https://github.com/kwales
)
[
#1562
](
https://github.com/CocoaPods/pull/1562
)
[
#1562
](
https://github.com/CocoaPods/pull/1562
)
*
When updating the pod repos, repositories with unreachable remotes
are now ignored. This fixes an issue with certain private repositories.
[
Joshua Kalpin
](
https://github.com/Kapin
)
[
#1595
](
https://github.com/CocoaPods/CocoaPods/pull/1595
)
[
#1571
](
https://github.com/CocoaPods/CocoaPods/issues/1571
)
## 0.28.0
## 0.28.0
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0
)
•
[
CocoaPods-core
](
https://github.com/CocoaPods/Core/compare/0.27.1...0.28.0
)
•
[
CocoaPods-core
](
https://github.com/CocoaPods/Core/compare/0.27.1...0.28.0
)
...
...
lib/cocoapods/sources_manager.rb
View file @
9e71add2
...
@@ -145,7 +145,7 @@ module Pod
...
@@ -145,7 +145,7 @@ module Pod
raise
Informative
,
"The `
#{
source_name
}
` repo is not a git repo."
unless
git_repo?
(
specified_source
.
repo
)
raise
Informative
,
"The `
#{
source_name
}
` repo is not a git repo."
unless
git_repo?
(
specified_source
.
repo
)
sources
=
[
specified_source
]
sources
=
[
specified_source
]
else
else
sources
=
aggregate
.
all
.
select
{
|
source
|
git_repo?
(
source
.
repo
)
}
sources
=
aggregate
.
all
.
select
{
|
source
|
git_repo?
(
source
.
repo
)
&&
git_remote_reachable?
(
source
.
repo
)
}
end
end
sources
.
each
do
|
source
|
sources
.
each
do
|
source
|
...
@@ -159,16 +159,28 @@ module Pod
...
@@ -159,16 +159,28 @@ module Pod
end
end
end
end
# Returns whether a git repo's remote is reachable.
#
# @param [Pathname] dir
# The directory where the source is stored.
#
# @return [Bool] Whether the given source's remote is reachable.
#
def
git_remote_reachable?
(
dir
)
Dir
.
chdir
(
dir
)
{
git
(
'ls-remote'
)
}
$?
.
success?
end
# Returns whether a source is a GIT repo.
# Returns whether a source is a GIT repo.
#
#
# @param [Pathname] dir
# @param [Pathname] dir
# The directory where the source is stored.
# The directory where the source is stored.
#
#
# @return [Bool] Wether the given source is a GIT repo.
# @return [Bool] W
h
ether the given source is a GIT repo.
#
#
def
git_repo?
(
dir
)
def
git_repo?
(
dir
)
Dir
.
chdir
(
dir
)
{
`git rev-parse >/dev/null 2>&1`
}
Dir
.
chdir
(
dir
)
{
git
(
'rev-parse >/dev/null 2>&1'
)
}
$?
.
exitstatus
.
zero
?
$?
.
success
?
end
end
# Checks the version information of the source with the given directory.
# Checks the version information of the source with the given directory.
...
...
spec/unit/sources_manager_spec.rb
View file @
9e71add2
...
@@ -95,6 +95,11 @@ module Pod
...
@@ -95,6 +95,11 @@ module Pod
UI
.
output
.
should
.
match
/Already up-to-date/
UI
.
output
.
should
.
match
/Already up-to-date/
end
end
it
'returns whether a source has a reachable git remote'
do
SourcesManager
.
git_remote_reachable?
(
repo_make
(
'a_new_repo_that_is_new'
)).
should
.
be
.
false
SourcesManager
.
git_remote_reachable?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
end
it
"returns whether a source is backed by a git repo"
do
it
"returns whether a source is backed by a git repo"
do
SourcesManager
.
git_repo?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_repo?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_repo?
(
Pathname
.
new
(
'/tmp'
)).
should
.
be
.
false
SourcesManager
.
git_repo?
(
Pathname
.
new
(
'/tmp'
)).
should
.
be
.
false
...
...
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