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
5cf3ee79
Commit
5cf3ee79
authored
Feb 07, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Setup full clone when using `--push`.
parent
c13be8c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
setup.rb
lib/cocoapods/command/setup.rb
+5
-7
setup_spec.rb
spec/functional/command/setup_spec.rb
+12
-0
No files found.
lib/cocoapods/command/setup.rb
View file @
5cf3ee79
...
@@ -25,8 +25,8 @@ module Pod
...
@@ -25,8 +25,8 @@ module Pod
executable
:git
executable
:git
def
initialize
(
argv
)
def
initialize
(
argv
)
@shallow
=
argv
.
flag?
(
'shallow'
,
true
)
@push_option
=
argv
.
flag?
(
'push'
)
@push_option
=
argv
.
flag?
(
'push'
)
@shallow
=
argv
.
flag?
(
'shallow'
,
!
@push_option
)
super
super
end
end
...
@@ -81,11 +81,9 @@ module Pod
...
@@ -81,11 +81,9 @@ module Pod
# @return [void]
# @return [void]
#
#
def
add_master_repo
def
add_master_repo
@command
||=
begin
cmd
=
[
'master'
,
url
,
'master'
]
cmd
=
[
'master'
,
url
,
'master'
]
cmd
<<
'--shallow'
if
@shallow
cmd
<<
'--shallow'
if
@shallow
Repo
::
Add
.
parse
(
cmd
).
run
Repo
::
Add
.
parse
(
cmd
).
run
end
end
end
# Updates the master repo against the remote.
# Updates the master repo against the remote.
...
@@ -117,7 +115,7 @@ module Pod
...
@@ -117,7 +115,7 @@ module Pod
# be enabled.
# be enabled.
#
#
def
url
def
url
(
push?
)
?
read_write_url
:
read_only_url
push?
?
read_write_url
:
read_only_url
end
end
# @return [String] the read only url of the master repo.
# @return [String] the read only url of the master repo.
...
...
spec/functional/command/setup_spec.rb
View file @
5cf3ee79
...
@@ -61,6 +61,18 @@ module Pod
...
@@ -61,6 +61,18 @@ module Pod
end
end
end
end
it
"creates a full clone of the `master` repo when push access is requested"
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_write_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
cmd
=
run_command
(
'setup'
,
'--push'
)
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
it
"preserves push access for the `master` repo"
do
output
=
run_command
(
'setup'
)
output
=
run_command
(
'setup'
)
output
.
should
.
not
.
include
"push"
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