10-remotes: check for remote branch
This commit is contained in:
@@ -56,10 +56,16 @@ module Shared
|
||||
run_cmd "git merge origin/#{branch}"
|
||||
end
|
||||
|
||||
def is_remote_branch (branch)
|
||||
`git branch -r|grep origin|grep -v 'HEAD'|grep #{branch}`.strip != ""
|
||||
end
|
||||
|
||||
def git_fetch_and_merge (branch)
|
||||
git_fetch
|
||||
if is_remote_branch(branch)
|
||||
git_remote_merge branch
|
||||
end
|
||||
end
|
||||
|
||||
def git_remote_branch_delete ( branch )
|
||||
run_cmd "git push origin :#{branch}"
|
||||
|
||||
Reference in New Issue
Block a user