lib/big_keeper/service/git_service.rb in bigkeeper-0.7.3 vs lib/big_keeper/service/git_service.rb in bigkeeper-0.7.4
- old
+ new
@@ -1,6 +1,7 @@
require 'big_keeper/util/git_operator'
+require 'big_keeper/util/gitflow_operator'
require 'big_keeper/model/gitflow_type'
require 'big_keeper/model/operate_type'
require 'big_keeper/util/logger'
module BigKeeper
@@ -10,10 +11,12 @@
git = GitOperator.new
branch_name = "#{GitflowType.name(type)}/#{name}"
if !git.has_remote_branch(path, branch_name) && !git.has_local_branch(path, branch_name)
+ GitflowOperator.new.verify_git_flow(path)
+
verify_special_branch(path, 'master')
verify_special_branch(path, 'develop')
GitflowOperator.new.start(path, name, type)
git.push_to_remote(path, branch_name)
@@ -119,11 +122,11 @@
if git.has_local_branch(path, branch_name)
Logger.highlight("Delete local branch '#{branch_name}' for '#{name}'...")
if git.current_branch(path) == branch_name
- git.dicard(path)
+ git.discard(path)
git.checkout(path, GitflowType.base_branch(type))
end
git.del_local(path, branch_name)
end
@@ -177,9 +180,11 @@
end
end
if GitOperator.new.current_branch(path) != 'develop' && GitOperator.new.current_branch(path) != 'master'
`git push -f`
GitOperator.new.checkout(path, branch_name)
+ else
+ Logger.error("You should not push 'master' or 'develop'")
end
end
end
end
end