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
f80f90e8
Commit
f80f90e8
authored
Mar 10, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Setup] Remove shallow option
parent
2721277a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
28 deletions
+6
-28
setup.rb
lib/cocoapods/command/setup.rb
+0
-12
sources_manager.rb
lib/cocoapods/sources_manager.rb
+5
-3
setup_spec.rb
spec/functional/command/setup_spec.rb
+1
-13
No files found.
lib/cocoapods/command/setup.rb
View file @
f80f90e8
...
@@ -14,20 +14,9 @@ module Pod
...
@@ -14,20 +14,9 @@ module Pod
If the clone already exists, it will ensure that it is up-to-date.
If the clone already exists, it will ensure that it is up-to-date.
DESC
DESC
def
self
.
options
[
[
'--no-shallow'
,
'Clone full history so push will work'
],
].
concat
(
super
)
end
extend
Executable
extend
Executable
executable
:git
executable
:git
def
initialize
(
argv
)
@shallow
=
argv
.
flag?
(
'shallow'
,
true
)
super
end
def
run
def
run
UI
.
section
'Setting up CocoaPods master repo'
do
UI
.
section
'Setting up CocoaPods master repo'
do
if
master_repo_dir
.
exist?
if
master_repo_dir
.
exist?
...
@@ -62,7 +51,6 @@ module Pod
...
@@ -62,7 +51,6 @@ module Pod
#
#
def
add_master_repo
def
add_master_repo
cmd
=
[
'master'
,
url
,
'master'
]
cmd
=
[
'master'
,
url
,
'master'
]
cmd
<<
'--shallow'
if
@shallow
Repo
::
Add
.
parse
(
cmd
).
run
Repo
::
Add
.
parse
(
cmd
).
run
end
end
...
...
lib/cocoapods/sources_manager.rb
View file @
f80f90e8
...
@@ -61,9 +61,11 @@ module Pod
...
@@ -61,9 +61,11 @@ module Pod
previous_title_level
=
UI
.
title_level
previous_title_level
=
UI
.
title_level
UI
.
title_level
=
0
UI
.
title_level
=
0
begin
begin
argv
=
[
name
,
url
]
if
name
=~
/^master(-\d+)?$/
argv
<<
'--shallow'
if
name
=~
/^master(-\d+)?$/
Command
::
Setup
.
parse
([]).
run
Command
::
Repo
::
Add
.
new
(
CLAide
::
ARGV
.
new
(
argv
)).
run
else
Command
::
Repo
::
Add
.
parse
([
name
,
url
]).
run
end
rescue
Informative
rescue
Informative
raise
Informative
,
"Unable to add a source with url `
#{
url
}
` "
\
raise
Informative
,
"Unable to add a source with url `
#{
url
}
` "
\
"named `
#{
name
}
`.
\n
You can try adding it manually in "
\
"named `
#{
name
}
`.
\n
You can try adding it manually in "
\
...
...
spec/functional/command/setup_spec.rb
View file @
f80f90e8
...
@@ -32,23 +32,11 @@ module Pod
...
@@ -32,23 +32,11 @@ module Pod
url
.
should
==
test_repo_path
.
to_s
url
.
should
==
test_repo_path
.
to_s
end
end
it
'creates a
shallow clone of the `master` repo by default
'
do
it
'creates a
full clone of the `master` repo
'
do
Dir
.
chdir
(
test_repo_path
)
do
Dir
.
chdir
(
test_repo_path
)
do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
end
# Need to use file:// to test local use of --depth=1
Command
::
Setup
.
stubs
(
:read_only_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
run_command
(
'setup'
)
run_command
(
'setup'
)
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
==
1
end
end
it
'creates a full clone of the `master` repo if requested'
do
Dir
.
chdir
(
test_repo_path
)
do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
run_command
(
'setup'
,
'--no-shallow'
)
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
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