lib/hu/deploy.rb in hu-1.4.8 vs lib/hu/deploy.rb in hu-1.4.9
- old
+ new
@@ -147,17 +147,17 @@
busy 'update working copy', :dots
wc_update.join
unbusy
- # unless develop_can_be_merged_into_master?
- # puts
- # puts "ERROR: It seems like a merge of 'develop' into 'master' would fail.".color(:red)
- # puts " Aborting early to prevent a merge conflict.".color(:red)
- # puts
- # exit 1
- # end
+ unless develop_can_be_merged_into_master?
+ puts
+ puts "ERROR: It seems like a merge of 'develop' into 'master' would fail.".color(:red)
+ puts " Aborting early to prevent a merge conflict.".color(:red)
+ puts
+ exit 1
+ end
highest_version = find_highest_version_tag
begin
highest_versionomy = Versionomy.parse(highest_version)
rescue
@@ -868,12 +868,11 @@
def develop_can_be_merged_into_master?
status = run_each <<-EOS.strip_heredoc
:quiet
:nospinner
:return
- git checkout develop
- git diff --exit-code --quiet develop..master || { git format-patch master --stdout >/tmp/hu.diff.tmp && git checkout master && git apply --check </tmp/hu.diff.tmp ; } || [ ! -s /tmp/hu.diff.tmp ]
- rm -f /tmp/hu.diff.tmp
+ git checkout master && git merge --no-commit --no-ff develop || { git merge --abort; false ;}
+ git merge --abort || true
EOS
status == 0
end
def current_branch_name