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
c13be8c6
Commit
c13be8c6
authored
Feb 07, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Setup shallow clones by default or use `--no-shallow`.
parent
a57091f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
setup.rb
lib/cocoapods/command/setup.rb
+10
-2
setup_spec.rb
spec/functional/command/setup_spec.rb
+22
-0
No files found.
lib/cocoapods/command/setup.rb
View file @
c13be8c6
...
...
@@ -15,13 +15,17 @@ module Pod
DESC
def
self
.
options
[[
"--push"
,
"Use this option to enable push access once granted"
]].
concat
(
super
)
[
[
"--no-shallow"
,
"Clone full history so push will work"
],
[
"--push"
,
"Use this option to enable push access once granted"
],
].
concat
(
super
)
end
extend
Executable
executable
:git
def
initialize
(
argv
)
@shallow
=
argv
.
flag?
(
'shallow'
,
true
)
@push_option
=
argv
.
flag?
(
'push'
)
super
end
...
...
@@ -77,7 +81,11 @@ module Pod
# @return [void]
#
def
add_master_repo
@command
||=
Repo
::
Add
.
parse
([
'master'
,
url
,
'master'
]).
run
@command
||=
begin
cmd
=
[
'master'
,
url
,
'master'
]
cmd
<<
'--shallow'
if
@shallow
Repo
::
Add
.
parse
(
cmd
).
run
end
end
# Updates the master repo against the remote.
...
...
spec/functional/command/setup_spec.rb
View file @
c13be8c6
...
...
@@ -39,6 +39,28 @@ module Pod
url
.
should
==
test_repo_path
.
to_s
end
it
"creates a shallow clone of the `master` repo by default"
do
Dir
.
chdir
(
test_repo_path
)
do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
# Need to use file:// to test local use of --depth=1
Command
::
Setup
.
any_instance
.
stubs
(
:read_only_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
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
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
end
end
it
"preserves push access for the `master` repo"
do
output
=
run_command
(
'setup'
)
output
.
should
.
not
.
include
"push"
...
...
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