14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/verat/hotfix.rb', line 14
def self.finish(hotfix, options)
puts "Finishing hotfix: #{hotfix}"
repo = Git.open(Dir.pwd)
branch = "hotfix-#{hotfix}"
if repo.current_branch() != 'master' and repo.is_branch?(branch)
repo.checkout('master')
status = system("git merge --no-ff #{branch}")
if status
repo.checkout('develop')
system("git merge --no-ff #{branch}")
end
else
status = system("git merge --no-ff #{branch}")
if status
repo.checkout('develop')
system("git merge --no-ff #{branch}")
end
end
if options['delete']
repo.branch(branch).delete
puts "Deleting branch: #{branch}"
end
puts "Finished succesfuly. Current branch: develop"
end
|