Skip to content

Commit

Permalink
Always use origin for checking if the heads point to the same commit
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Sep 2, 2024
1 parent 1391584 commit b7c9ced
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.run(params)
github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token])
target_milestone = milestone_title.nil? ? nil : github_helper.get_milestone(repository, milestone_title)

Git.open(Dir.pwd).fetch('origin')
Git.open(Dir.pwd).fetch

final_target_branches = if target_branches.empty?
unless source_branch.start_with?('release/')
Expand Down Expand Up @@ -105,7 +105,10 @@ def self.create_backmerge_pr(token:, repository:, title:, head_branch:, base_bra
# if there's a callback, make sure it didn't switch branches
other_action.ensure_git_branch(branch: "^#{intermediate_branch}/") unless intermediate_branch_created_callback.nil?

if Fastlane::Helper::GitHelper.point_to_same_commit?(base_branch, head_branch)
base_branch_ref = "origin/#{base_branch}" unless base_branch.start_with?('origin/')
head_branch_ref = "origin/#{head_branch}" unless head_branch.start_with?('origin/')

if Fastlane::Helper::GitHelper.point_to_same_commit?(base_branch_ref, head_branch_ref)
UI.error("No differences between #{head_branch} and #{base_branch}. Skipping PR creation.")
return nil
end
Expand Down

0 comments on commit b7c9ced

Please sign in to comment.