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
027b9f27
Commit
027b9f27
authored
Mar 30, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1978 from neonichu/master
Make SourcesManager ignore some global git configs
parents
c6397992
01c86d92
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
sources_manager.rb
lib/cocoapods/sources_manager.rb
+1
-1
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+29
-10
No files found.
lib/cocoapods/sources_manager.rb
View file @
027b9f27
...
@@ -152,7 +152,7 @@ module Pod
...
@@ -152,7 +152,7 @@ module Pod
sources
.
each
do
|
source
|
sources
.
each
do
|
source
|
UI
.
section
"Updating spec repo `
#{
source
.
name
}
`"
do
UI
.
section
"Updating spec repo `
#{
source
.
name
}
`"
do
Dir
.
chdir
(
source
.
data_provider
.
repo
)
do
Dir
.
chdir
(
source
.
data_provider
.
repo
)
do
output
=
git!
(
"pull"
)
output
=
git!
(
"pull
--no-rebase --no-commit
"
)
UI
.
puts
output
if
show_output
&&
!
config
.
verbose?
UI
.
puts
output
if
show_output
&&
!
config
.
verbose?
end
end
check_version_information
(
source
.
data_provider
.
repo
)
check_version_information
(
source
.
data_provider
.
repo
)
...
...
spec/unit/sources_manager_spec.rb
View file @
027b9f27
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
def
set_up_test_repo_for_update
set_up_test_repo
upstream
=
SpecHelper
.
temporary_directory
+
'upstream'
FileUtils
.
cp_r
(
test_repo_path
,
upstream
)
Dir
.
chdir
(
test_repo_path
)
do
`git remote add origin
#{
upstream
}
`
`git remote -v`
`git fetch -q`
`git branch --set-upstream-to=origin/master master`
`git config branch.master.rebase true`
end
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
end
module
Pod
module
Pod
describe
SourcesManager
do
describe
SourcesManager
do
...
@@ -87,21 +101,26 @@ module Pod
...
@@ -87,21 +101,26 @@ module Pod
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
"update source backed by a git repository"
do
it
"update source backed by a git repository"
do
set_up_test_repo
set_up_test_repo_for_update
upstream
=
SpecHelper
.
temporary_directory
+
'upstream'
FileUtils
.
cp_r
(
test_repo_path
,
upstream
)
Dir
.
chdir
(
test_repo_path
)
do
`git remote add origin
#{
upstream
}
`
`git remote -v`
`git fetch -q`
`git branch --set-upstream-to=origin/master master`
end
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
UI
.
output
.
should
.
match
/Already up-to-date/
UI
.
output
.
should
.
match
/Already up-to-date/
end
end
it
"is robust against user settings for git repos"
do
set_up_test_repo_for_update
SourcesManager
.
expects
(
:git!
).
with
()
{
|
options
|
options
.
should
.
match
/--no-rebase/
}
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
end
it
"doesn't allow merge commits"
do
set_up_test_repo_for_update
SourcesManager
.
expects
(
:git!
).
with
()
{
|
options
|
options
.
should
.
match
/--no-commit/
}
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
end
it
'returns whether a source has a reachable git remote'
do
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?
(
repo_make
(
'a_new_repo_that_is_new'
)).
should
.
be
.
false
SourcesManager
.
git_remote_reachable?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_remote_reachable?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
...
...
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