Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Squash

hotfix_branch = "hotfix/asf"
release_branch = "release/asf"
master_branch = "master"
feature_branch = "1923_core_something"

def check_branch(source_branch, squash)
    is_release_branch = (/^(release\/).*$/.match(source_branch))
    is_hotfix_branch = (/^(hotfix\/).*$/.match(source_branch))
    is_master_branch = source_branch == "master"
   
   
    
    #puts "🏸 Please check the squash option in the merge request settings. Think about our nice changelog 🙏" unless is_release_branch || is_hotfix_branch || is_master_branch || squash
    
    unless squash || is_release_branch || is_hotfix_branch || is_master_branch 
       puts "🏸 Please check the squash option in the merge request settings. Think about our nice changelog 🙏" 
    else
       puts "MR ok!"
    end
end

puts "* Checking hotfix branch with squash"
check_branch(hotfix_branch, true)
puts "* Checking hotfix branch without squash"
check_branch(hotfix_branch, false)

puts "* Checking release branch with squash"
check_branch(release_branch, true)
puts "* Checking release branch without squash"
check_branch(release_branch, false)

puts "* Checking master branch with squash"
check_branch(master_branch, true)
puts "* Checking master branch without squash"
check_branch(master_branch, false)

puts "* Checking feature branch with squash"
check_branch(feature_branch, true)
puts "* Checking feature branch without squash"
check_branch(feature_branch, false)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.