Skip to content

Commit 1dbd980

Browse files
committed
Don't use --single-branch option
1 parent bd7ff73 commit 1dbd980

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/pmdtester/builders/project_builder.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ def clone_projects
2525
clone_cmd = "#{project.type} clone #{project.connection} #{path}"
2626

2727
if project.type == 'git'
28-
clone_cmd += " --depth 1 --branch #{project.tag} --single-branch" # don't download whole history
28+
# Don't download whole history
29+
# Note we don't use --single-branch, because the repo is downloaded
30+
# once but may be used with several tags.
31+
clone_cmd += ' --depth 1'
2932
end
3033
Cmd.execute(clone_cmd)
3134
end

test/test_project_builder.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def test_build
3838

3939
def expect_git_clone(name, url, revision)
4040
File.stubs(:exist?).with("target/repositories/#{name}").returns(false).once
41-
PmdTester::Cmd.stubs(:execute).with("git clone #{url} target/repositories/#{name} " \
42-
"--depth 1 --branch #{revision} --single-branch").once
41+
PmdTester::Cmd.stubs(:execute).with("git clone #{url} target/repositories/#{name} --depth 1").once
4342
Dir.stubs(:chdir).with("target/repositories/#{name}").yields.once
4443
PmdTester::Cmd.stubs(:execute).with("git checkout #{revision}; git reset --hard #{revision}").once
4544
end

0 commit comments

Comments
 (0)