Skip to content

Commit 6c75b1a

Browse files
committed
Fix integration test
1 parent c37713d commit 6c75b1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/pmdtester/builders/pmd_report_builder.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ def initialize(projects, options, branch_config, branch_name)
2525
def get_pmd_binary_file
2626
logger.info "#{@pmd_branch_name}: Start packaging PMD"
2727
Dir.chdir(@local_git_repo) do
28-
build_branch_sha = Cmd.execute_successfully("git rev-parse #{@pmd_branch_name}^{commit}")
29-
3028
checkout_build_branch # needs a clean working tree, otherwise fails
3129

30+
# first checkout the build branch - that might create a local branch from remote, if
31+
# a local branch doesn't exist yet. The following "git rev-parse" command only works
32+
# for local branches.
33+
build_branch_sha = Cmd.execute_successfully("git rev-parse #{@pmd_branch_name}^{commit}")
34+
3235
raise "Wrong branch #{get_last_commit_sha}" unless build_branch_sha == get_last_commit_sha
3336

3437
distro_path = saved_distro_path(build_branch_sha)

0 commit comments

Comments
 (0)