Skip to content

Commit 458e13d

Browse files
committed
Update code to ensure the new hotfix branch doesn't exist
1 parent 701debb commit 458e13d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fastlane/Fastfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,12 @@ platform :ios do
445445
# Fetch the base ref to ensure it's available locally
446446
sh('git', 'fetch', 'origin', base_ref_for_hotfix)
447447

448+
hotfix_branch = "release/#{version}"
449+
ensure_branch_does_not_exist!(hotfix_branch)
450+
448451
# Create the hotfix branch
449452
UI.message("Creating hotfix branch from '#{base_ref_for_hotfix}'...")
450-
Fastlane::Helper::GitHelper.create_branch("release/#{version}", from: base_ref_for_hotfix)
453+
Fastlane::Helper::GitHelper.create_branch(hotfix_branch, from: base_ref_for_hotfix)
451454
UI.success("Done! New hotfix branch is: '#{git_branch}'")
452455

453456
# Bump the hotfix version and build code and write it to the `xcconfig` file

0 commit comments

Comments
 (0)