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
2721277a
Commit
2721277a
authored
Mar 10, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SourcesManager] Unshallow when updating a specs repo
parent
70350dc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
sources_manager.rb
lib/cocoapods/sources_manager.rb
+13
-0
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+11
-0
No files found.
lib/cocoapods/sources_manager.rb
View file @
2721277a
...
...
@@ -625,6 +625,7 @@ module Pod
end
def
update_git_repo
(
show_output
=
false
)
ensure_in_repo!
Config
.
instance
.
with_changes
(
:verbose
=>
show_output
)
do
git!
(
%w(pull --ff-only)
)
end
...
...
@@ -635,4 +636,16 @@ module Pod
'`pod repo update --verbose`'
end
end
class
MasterSource
def
update_git_repo
(
show_output
=
false
)
ensure_in_repo!
if
repo
.
join
(
'.git'
,
'shallow'
).
file?
UI
.
info
"Performing a deep fetch of the `
#{
name
}
` specs repo to improve future performance"
do
git!
(
%w(fetch --unshallow)
)
end
end
super
end
end
end
spec/unit/sources_manager_spec.rb
View file @
2721277a
...
...
@@ -314,6 +314,17 @@ module Pod
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
end
it
'unshallows if the git repo is shallow'
do
set_up_test_repo_for_update
test_repo_path
.
join
(
'.git'
,
'shallow'
).
open
(
'w'
)
{
|
f
|
f
<<
'a'
*
40
}
SourcesManager
.
expects
(
:update_search_index_if_needed_in_background
).
with
({}).
returns
(
nil
)
MasterSource
.
any_instance
.
expects
(
:git!
).
with
(
%w(fetch --unshallow)
)
MasterSource
.
any_instance
.
expects
(
:git!
).
with
(
%w(pull --ff-only)
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
UI
.
output
.
should
.
match
/deep fetch.+`master`.+improve future performance/
end
it
'prints a warning if the update failed'
do
set_up_test_repo_for_update
Source
.
any_instance
.
stubs
(
:git
).
with
(
%w(rev-parse HEAD)
).
returns
(
'aabbccd'
)
...
...
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