Merge pull request #26 from rmm5t/fix-branch-check
Fix branch selection logic for git deploys
This commit is contained in:
commit
36ba3b9086
1 changed files with 1 additions and 1 deletions
|
@ -158,7 +158,7 @@ EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
#if there is a branch with that name, switch to it, otherwise create a new one and switch to it
|
#if there is a branch with that name, switch to it, otherwise create a new one and switch to it
|
||||||
if `git branch`.split("\n").delete_if{ |r| r =~ Regexp.new(branch,true) }.count == 0
|
if `git branch`.split("\n").any? { |b| b =~ /#{branch}/i }
|
||||||
`git checkout #{branch}`
|
`git checkout #{branch}`
|
||||||
else
|
else
|
||||||
`git checkout -b #{branch}`
|
`git checkout -b #{branch}`
|
||||||
|
|
Loading…
Reference in a new issue