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
977bddb5
Commit
977bddb5
authored
Mar 10, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Repo::Add] Remove shallow clones entirely
parent
e07b2102
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
21 deletions
+1
-21
add.rb
lib/cocoapods/command/repo/add.rb
+1
-10
add_spec.rb
spec/functional/command/repo/add_spec.rb
+0
-11
No files found.
lib/cocoapods/command/repo/add.rb
View file @
977bddb5
...
...
@@ -15,14 +15,7 @@ module Pod
CLAide
::
Argument
.
new
(
'BRANCH'
,
false
),
]
def
self
.
options
[
[
'--shallow'
,
'Create a shallow clone (fast clone, but no push capabilities)'
],
].
concat
(
super
)
end
def
initialize
(
argv
)
@shallow
=
argv
.
flag?
(
'shallow'
,
false
)
@name
=
argv
.
shift_argument
@url
=
argv
.
shift_argument
@branch
=
argv
.
shift_argument
...
...
@@ -41,8 +34,7 @@ module Pod
end
def
run
prefix
=
@shallow
?
'Creating shallow clone of'
:
'Cloning'
section
=
"
#{
prefix
}
spec repo `
#{
@name
}
` from `
#{
@url
}
`"
section
=
"Cloning spec repo `
#{
@name
}
` from `
#{
@url
}
`"
section
<<
" (branch `
#{
@branch
}
`)"
if
@branch
UI
.
section
(
section
)
do
create_repos_dir
...
...
@@ -76,7 +68,6 @@ module Pod
def
clone_repo
Dir
.
chdir
(
config
.
repos_dir
)
do
command
=
[
'clone'
,
@url
,
@name
]
command
<<
'--depth=1'
if
@shallow
git!
(
command
)
end
end
...
...
spec/functional/command/repo/add_spec.rb
View file @
977bddb5
...
...
@@ -28,17 +28,6 @@ module Pod
Dir
.
chdir
(
repo2
.
dir
)
{
`git symbolic-ref HEAD`
}.
should
.
include?
'my-branch'
end
it
'adds a spec-repo by creating a shallow clone'
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
run_command
(
'repo'
,
'add'
,
'private'
,
'--shallow'
,
"file://
#{
test_repo_path
}
"
)
Dir
.
chdir
(
config
.
repos_dir
+
'private'
)
do
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
==
1
end
end
it
'raises an informative error when the repos directory fails to be created'
do
repos_dir
=
config
.
repos_dir
def
repos_dir
.
mkpath
...
...
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