Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move `remotes` into method

  • Loading branch information...
commit f4167c1610926bd061a954f989a17bd4a964214b 1 parent 608da98
@aanand authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/git-up.rb
View
5 lib/git-up.rb
@@ -3,7 +3,6 @@
class GitUp
def run
- remotes = remote_map.values.map {|r| r.name.split('/', 2).first}.uniq
system('git', 'fetch', '--multiple', *remotes)
raise GitError, "`git fetch` failed" unless $? == 0
@@ -64,6 +63,10 @@ def branches
@branches ||= repo.branches.select { |b| remote_map.has_key?(b.name) }
end
+ def remotes
+ @remotes ||= remote_map.values.map { |r| r.name.split('/', 2).first }.uniq
+ end
+
def remote_map
@remote_map ||= repo.branches.inject({}) { |map, branch|
if remote = remote_for_branch(branch)
Please sign in to comment.
Something went wrong with that request. Please try again.