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
f19d8483
Commit
f19d8483
authored
Sep 26, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pod setup] Remove write access option
This is no longer relevant with trunk Closes #2519
parent
45a06bc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
57 deletions
+3
-57
setup.rb
lib/cocoapods/command/setup.rb
+3
-31
setup_spec.rb
spec/functional/command/setup_spec.rb
+0
-26
No files found.
lib/cocoapods/command/setup.rb
View file @
f19d8483
...
...
@@ -17,7 +17,6 @@ module Pod
def
self
.
options
[
[
'--no-shallow'
,
'Clone full history so push will work'
],
[
'--push'
,
'Use this option to enable push access once granted'
],
].
concat
(
super
)
end
...
...
@@ -25,8 +24,7 @@ module Pod
executable
:git
def
initialize
(
argv
)
@push_option
=
argv
.
flag?
(
'push'
)
@shallow
=
argv
.
flag?
(
'shallow'
,
!
@push_option
)
@shallow
=
argv
.
flag?
(
'shallow'
,
true
)
super
end
...
...
@@ -43,8 +41,7 @@ module Pod
end
end
access_type
=
push?
?
'push'
:
'read-only'
UI
.
puts
"Setup completed (
#{
access_type
}
access)"
.
green
UI
.
puts
"Setup completed"
.
green
end
#--------------------------------------#
...
...
@@ -116,7 +113,7 @@ module Pod
# be enabled.
#
def
url
push?
?
self
.
class
.
read_write_url
:
self
.
class
.
read_only_url
self
.
class
.
read_only_url
end
# @return [String] the read only url of the master repo.
...
...
@@ -125,31 +122,6 @@ module Pod
'https://github.com/CocoaPods/Specs.git'
end
# @return [String] the read-write url of the master repo.
#
def
self
.
read_write_url
'git@github.com:CocoaPods/Specs.git'
end
# Checks if the user asked to setup the master repo in push mode or if
# the repo was already in push mode.
#
# @return [String] whether the master repo should be set up in push mode.
#
def
push?
@push
||=
(
@push_option
||
master_repo_is_push?
)
end
# @return [Bool] if the master repo is already configured in push mode.
#
def
master_repo_is_push?
return
false
unless
master_repo_dir
.
exist?
Dir
.
chdir
(
master_repo_dir
)
do
url
=
git
(
'config --get remote.origin.url'
)
url
.
chomp
==
self
.
class
.
read_write_url
end
end
# @return [Pathname] the directory of the master repo.
#
def
master_repo_dir
...
...
spec/functional/command/setup_spec.rb
View file @
f19d8483
...
...
@@ -15,12 +15,6 @@ module Pod
cmd
.
url
.
should
==
'https://github.com/CocoaPods/Specs.git'
end
it
'returns the push URL of the `master` spec-repo'
do
config
.
silent
=
true
cmd
=
Command
::
Setup
.
new
(
argv
(
'--push'
))
cmd
.
url
.
should
==
'git@github.com:CocoaPods/Specs.git'
end
before
do
set_up_test_repo
Command
::
Setup
.
stubs
(
:read_only_url
).
returns
(
test_repo_path
.
to_s
)
...
...
@@ -34,7 +28,6 @@ module Pod
it
'creates the local spec-repos directory and creates a clone of the `master` repo'
do
output
=
run_command
(
'setup'
)
output
.
should
.
include
'Setup completed'
output
.
should
.
not
.
include
'push'
url
=
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
{
`git config --get remote.origin.url`
.
chomp
}
url
.
should
==
test_repo_path
.
to_s
end
...
...
@@ -61,25 +54,6 @@ module Pod
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
.
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
output
=
run_command
(
'setup'
)
output
.
should
.
not
.
include
'push'
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
{
`git remote set-url origin git@github.com:CocoaPods/Specs.git`
}
command
(
'setup'
).
url
.
should
==
'git@github.com:CocoaPods/Specs.git'
end
before
do
FileUtils
.
rm_rf
(
test_repo_path
)
set_up_old_test_repo
...
...
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