Module: Nucleus::Adapters::GitRepoAnalyzer
- Defined in:
- lib/nucleus/core/file_handling/git_repo_analyzer.rb
Class Method Summary collapse
-
.any_branch?(repo_host, repo_name, username) ⇒ TrueClass, FalseClass
Is the repository having any branch?.
Class Method Details
.any_branch?(repo_host, repo_name, username) ⇒ TrueClass, FalseClass
Is the repository having any branch?
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/nucleus/core/file_handling/git_repo_analyzer.rb', line 9 def self.any_branch?(repo_host, repo_name, username) detected_branch = false = { forward_agent: true, auth_methods: ['publickey'], keys: [nucleus_config.ssh.handler.key_file], keys_only: true } Net::SSH.start(repo_host, username, ) do |ssh| ssh.exec! "git-upload-pack '/#{repo_name}.git'" do |ch, stream, data| detected_branch = (detected_branch || data != '0000') unless stream == :stderr ch.close end end detected_branch end |