Commit 977bddb5 authored by Samuel Giddins's avatar Samuel Giddins

[Repo::Add] Remove shallow clones entirely

parent e07b2102
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment