diff --git a/lib/elm_install/git_source.rb b/lib/elm_install/git_source.rb index c98e1b0..f518e31 100644 --- a/lib/elm_install/git_source.rb +++ b/lib/elm_install/git_source.rb @@ -7,6 +7,8 @@ class GitSource < Source # @return [Branch] The branch attr_reader :branch + @@fetched = {} + Contract Uri, Branch => GitSource # Initializes a git source by URI and branch # @@ -70,9 +72,10 @@ def copy_to(version, directory) # # @return [Array] The versions def versions(constraints) - if repository.cloned? + if repository.cloned? && !@@fetched[url] # Get updates from upstream Logger.arrow "Getting updates for: #{package_name.bold}" + @@fetched[url] = true repository.fetch end diff --git a/lib/elm_install/resolver.rb b/lib/elm_install/resolver.rb index a444134..4979fb3 100644 --- a/lib/elm_install/resolver.rb +++ b/lib/elm_install/resolver.rb @@ -36,8 +36,6 @@ def resolve # # @return nil def resolve_dependency(dependency) - return if @dependencies[dependency.name] - @dependencies[dependency.name] ||= dependency dependency