Permalink
Browse files

Move `remotes` into method

  • Loading branch information...
1 parent 608da98 commit f4167c1610926bd061a954f989a17bd4a964214b @aanand committed Jan 28, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/git-up.rb
View
@@ -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)

0 comments on commit f4167c1

Please sign in to comment.