Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pull origin branch whenever checking out remote branch

  • Loading branch information...
commit 7fba45df001090ec1bdbe78e3f3c0d2abf9c6825 1 parent aa4dcd5
Tung Nguyen tongueroo authored
Showing with 11 additions and 5 deletions.
  1. +6 −3 features/gitcycle.feature
  2. +5 −2 lib/gitcycle.rb
9 features/gitcycle.feature
View
@@ -34,7 +34,8 @@ Scenario: Feature branch w/ custom branch name
Adding remote repo 'config.owner/config.repo'.
Fetching remote repo 'config.owner/config.repo'.
Checking out remote branch 'ticket.id-rename' from 'config.owner/config.repo/master'.
- Pushing 'ticket.id-rename'.
+ Pulling 'origin/ticket.id-rename'.
+ Pushing 'origin/ticket.id-rename'.
Sending branch information to gitcycle.
"""
And redis entries valid
@@ -55,7 +56,8 @@ Scenario: Feature branch
Adding remote repo 'config.owner/config.repo'.
Fetching remote repo 'config.owner/config.repo'.
Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
- Pushing 'ticket.id'.
+ Pulling 'origin/ticket.id'.
+ Pushing 'origin/ticket.id'.
Sending branch information to gitcycle.
"""
And redis entries valid
@@ -178,7 +180,8 @@ Scenario: QA issue
Adding remote repo 'config.owner/config.repo'.
Fetching remote repo 'config.owner/config.repo'.
Checking out remote branch 'qa_master' from 'config.owner/config.repo/master'.
- Pushing 'qa_master'.
+ Pulling 'origin/qa_master'.
+ Pushing 'origin/qa_master'.
Adding remote repo 'config.user/config.repo'.
Fetching remote repo 'config.user/config.repo'.
Merging remote branch 'ticket.id' from 'config.user/config.repo'.
7 lib/gitcycle.rb
View
@@ -378,7 +378,7 @@ def checkout_remote_branch(options={})
if branches(:match => target)
unless yes?("You already have a branch called '#{target}'. Overwrite?")
run("git checkout #{target}")
- run("git pull #{owner} #{target}")
+ run("git pull origin #{target}")
return
end
end
@@ -388,7 +388,10 @@ def checkout_remote_branch(options={})
puts "Checking out remote branch '#{target}' from '#{owner}/#{repo}/#{branch}'.\n".green
run("git checkout -b #{target} #{owner}/#{branch}")
- puts "Pushing '#{target}'.\n".green
+ puts "Pulling 'origin/#{target}'.\n".green
+ run("git pull origin #{target}")
+
+ puts "Pushing 'origin/#{target}'.\n".green
run("git push origin #{target}")
end
Please sign in to comment.
Something went wrong with that request. Please try again.