From 6b6f928e75ee21b8aa16e5c1f0a76105fe129453 Mon Sep 17 00:00:00 2001 From: Benjamin Knofe Date: Wed, 2 Jan 2013 22:38:24 +0100 Subject: [PATCH] git: remove origin fetching, fixes #9 --- lib/middleman-deploy/commands.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/middleman-deploy/commands.rb b/lib/middleman-deploy/commands.rb index 98a5101..c02c574 100644 --- a/lib/middleman-deploy/commands.rb +++ b/lib/middleman-deploy/commands.rb @@ -147,11 +147,9 @@ EOF end end - `git fetch origin` - - #if there is a remote branch with that name, reset to it, otherwise just create a new one - if `git branch -r`.split("\n").keep_if{ |r| r =~ Regexp.new(branch,true) }.count > 0 - `git reset --hard origin/#{branch}` + #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 + `git checkout #{branch}` else `git checkout -b #{branch}` end