lib/teapot/command/fetch.rb in teapot-3.4.1 vs lib/teapot/command/fetch.rb in teapot-3.5.0

- old
+ new

@@ -133,30 +133,30 @@ if base_uri.scheme == nil || base_uri.scheme == 'file' base_uri = URI "file://" + File.expand_path(base_uri.path, context.root) + "/" end - branch_name = package.options.fetch(:branch, 'master') + branch_name = package.options[:branch] if package_lock logger.info "Package locked to commit: #{package_lock[:branch]}/#{package_lock[:commit]}" branch_name = package_lock[:branch] commit_id = package_lock[:commit] end if destination_path.exist? - logger.info "Updating package at path #{destination_path}..." #.color(:cyan) + logger.info "Updating package at path #{destination_path}..." repository = Rugged::Repository.new(destination_path.to_s) # Are there uncommitted changes in the work tree? if repository.to_enum(:status).any? raise FetchError.new(package, "Uncommited local modifications") end repository.fetch('origin', credentials: self.method(:credentials)) - repository.checkout(branch_name) + repository.checkout(branch_name) if branch_name # Essentially implement git pull: if commit_id # Lookup the named branch: branch = repository.branches[branch_name].resolve