Sha256: 844f35cf8e8da059be77711e7b7ce489f4ec76a67f1ddc0f3653a13cf1de815b
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
# encoding: UTF-8 java_import 'org.eclipse.jgit.api.Git' module Rosette module Queuing module Commits # Fetches the repository. This should be the first commit processing stage # since it ensures the given commit is available in the repository for # processing. # # @see RepoConfig class FetchStage < Stage accepts PhraseStatus::NOT_SEEN, PhraseStatus::NOT_FOUND # Executes this stage and updates the commit log with a +FETCHED+ # status. Performs a git fetch. # # @return [void] def execute! logger.info("Fetching git repository #{repo_config.name}") git.fetch .setRemote('origin') .setRemoveDeletedRefs(true) .call commit_log.fetch # git won't know about the commit before a fetch, which is why branch # name is set in this stage and not when the commit is first enqueued commit_log.branch_name = Rosette::Core::BranchUtils.derive_branch_name( commit_log.commit_id, repo_config.repo ) save_commit_log logger.info("Finished fetching git repository #{repo_config.name}") end private def git @git ||= Git.new(repo_config.repo.jgit_repo) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rosette-core-1.0.1 | lib/rosette/queuing/commits/fetch_stage.rb |