Skip to content

Commit dbe0838

Browse files
committed
Fix setting commit when empty string
1 parent da1781a commit dbe0838

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/jobs/github_checkout_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def commit=(value)
2222
def perform(owner:, project:, commit: nil)
2323
self.owner = owner
2424
self.project = project
25-
self.commit = commit || primary_branch
25+
self.commit = commit.present? ? commit : primary_branch
2626

2727
raise DisallowedCheckoutError.new(owner:, project:) if library_version.disallowed?
2828

@@ -64,7 +64,7 @@ def run_checkout_clone
6464
clone_cmd = "git clone --depth 1 --single-branch #{branch_opt}#{url.inspect} #{temp_clone_path.to_s.inspect}"
6565
sh(clone_cmd, title: "Cloning project #{name}")
6666

67-
if commit.nil?
67+
if commit.blank?
6868
self.commit = `git -C #{temp_clone_path.to_s.inspect} rev-parse --abbrev-ref HEAD`.strip
6969
end
7070

0 commit comments

Comments
 (0)