Merge pull request #10 from benben/9_git_deploy_fix

git: remove origin fetching, fixes #9
This commit is contained in:
Tom Vaughan 2013-01-03 04:31:16 -08:00
commit dbc310ec11

View file

@ -147,11 +147,9 @@ EOF
end end
end end
`git fetch origin` #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").keep_if{ |r| r =~ Regexp.new(branch,true) }.count > 0
#if there is a remote branch with that name, reset to it, otherwise just create a new one `git checkout #{branch}`
if `git branch -r`.split("\n").keep_if{ |r| r =~ Regexp.new(branch,true) }.count > 0
`git reset --hard origin/#{branch}`
else else
`git checkout -b #{branch}` `git checkout -b #{branch}`
end end