Permalink
Browse files

Uncache the remote host & path each time 'pushed.push' is invoked, so…

… multiple separate pushes can be done at once.
  • Loading branch information...
1 parent e81fc3f commit 097e660ad2804fbafe1918fd1add0e34d9d5fa3d @benhoskings committed Jan 17, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 push.rb
View
@@ -12,8 +12,9 @@ def self.remote_head remote
def remote_host; self.class.remote_host_and_path(remote).first end
def remote_path; self.class.remote_host_and_path(remote).last end
def remote_head; self.class.remote_head(remote) end
- def self.uncache_remote_head!
+ def self.uncache!
@remote_head = nil
+ @remote_host_and_path = nil
end
def git_log from, to
if from[/^0+$/]
@@ -46,6 +47,7 @@ def git_log from, to
end
dep 'pushed.push', :ref, :remote do
+ self.class.uncache!
ref.ask("What would you like to push?").default('HEAD')
remote.ask("Where would you like to push to?").choose(repo.repo_shell('git remote').split("\n"))
requires [
@@ -62,7 +64,7 @@ def git_log from, to
confirm "OK to push #{ref} to #{remote} (#{repo.repo_shell("git config remote.#{remote}.url")})?" do
push_cmd = "git push #{remote} #{ref}:master -f"
log push_cmd.colorize("on grey") do
- self.class.uncache_remote_head!
+ self.class.uncache!
shell push_cmd, :log => true
end
end

0 comments on commit 097e660

Please sign in to comment.