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
dcd85e72
Commit
dcd85e72
authored
May 29, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Repo] Allow to specify a branch for new repos.
parent
319f8b9b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
repo.rb
lib/cocoapods/command/repo.rb
+3
-1
repo_spec.rb
spec/functional/command/repo_spec.rb
+6
-0
temporary_repos.rb
spec/spec_helper/temporary_repos.rb
+4
-1
No files found.
lib/cocoapods/command/repo.rb
View file @
dcd85e72
...
...
@@ -6,7 +6,7 @@ module Pod
def
self
.
banner
%{Managing spec-repos:
$ pod repo add NAME URL
$ pod repo add NAME URL
[BRANCH]
Clones `URL' in the local spec-repos directory at `~/.cocoapods'. The
remote can later be referred to by `NAME'.
...
...
@@ -26,6 +26,7 @@ module Pod
unless
(
@name
=
argv
.
arguments
[
1
])
&&
(
@url
=
argv
.
arguments
[
2
])
raise
Informative
,
"
#{
@action
==
'add'
?
'Adding'
:
'Updating the remote of'
}
a repo needs a `name' and a `url'."
end
@branch
=
argv
.
arguments
[
3
]
when
'update'
@name
=
argv
.
arguments
[
1
]
else
...
...
@@ -45,6 +46,7 @@ module Pod
puts
"Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'"
unless
config
.
silent?
config
.
repos_dir
.
mkpath
Dir
.
chdir
(
config
.
repos_dir
)
{
git
(
"clone '
#{
@url
}
'
#{
@name
}
"
)
}
Dir
.
chdir
(
dir
)
{
git
(
"checkout
#{
@branch
}
"
)
}
if
@branch
check_versions
(
dir
)
end
...
...
spec/functional/command/repo_spec.rb
View file @
dcd85e72
...
...
@@ -21,6 +21,12 @@ describe "Pod::Command::Repo" do
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'spec-repos/master'
).
to_s
end
it
"adds a spec-repo with on a specified branch"
do
repo
=
command
(
'repo'
,
'add'
,
'new'
,
fixture
(
'spec-repos/master'
),
'0.6'
)
repo
.
run
Dir
.
chdir
(
repo
.
dir
)
{
`git symbolic-ref HEAD`
}.
should
.
include?
'0.6'
end
it
"updates a spec-repo"
do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
...
...
spec/spec_helper/temporary_repos.rb
View file @
dcd85e72
...
...
@@ -30,7 +30,10 @@ module SpecHelper
def
add_repo
(
name
,
from
)
command
=
command
(
'repo'
,
'add'
,
name
,
from
)
command
.
run
Dir
.
chdir
(
command
.
dir
)
{
`git checkout -b test >/dev/null 2>&1`
}
Dir
.
chdir
(
command
.
dir
)
do
`git checkout -b test >/dev/null 2>&1`
`git branch --set-upstream test origin/test >/dev/null 2>&1`
end
command
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