Module: Git Deprecated

Defined in:
lib/spm_version_updates/git.rb

Overview

Deprecated.

Use GitOperations from the spm_version_updates core gem instead. This shim exists only for backward compatibility with Dangerfiles written against v0.2.0.

Legacy git helper used by the Danger plugin API. Delegates to GitOperations, so lookups gain its retry behavior and raise GitOperations::LsRemoteError instead of masking failures as empty results.

Constant Summary collapse

ALLOWED_PROTOCOLS =
GitOperations::ALLOWED_PROTOCOLS

Class Method Summary collapse

Class Method Details

.branch_last_commit(repo_url, branch_name) ⇒ String?

Call git to find the last commit on a branch

Parameters:

  • repo_url (String)

    The URL of the dependency’s repository

  • branch_name (String)

    The name of the branch on which to find the last commit

Returns:

  • (String, nil)

Raises:

  • (GitOperations::LsRemoteError)

    if the lookup fails after retries



45
46
47
# File 'lib/spm_version_updates/git.rb', line 45

def self.branch_last_commit(repo_url, branch_name)
  GitOperations.branch_last_commit(repo_url, branch_name)
end

.repo_name(repo_url) ⇒ String

Extract a readable name for the repo given the url, generally org/repo

Returns:

  • (String)


25
26
27
# File 'lib/spm_version_updates/git.rb', line 25

def self.repo_name(repo_url)
  GitOperations.repo_name(repo_url)
end

.trim_repo_url(repo_url) ⇒ String

Removes protocol and trailing .git from a repo URL

Parameters:

  • repo_url (String)

    The URL of the repository

Returns:

  • (String)


19
20
21
# File 'lib/spm_version_updates/git.rb', line 19

def self.trim_repo_url(repo_url)
  GitOperations.trim_repo_url(repo_url)
end

.version_tags(repo_url) ⇒ Array<SpmVersionUpdates::Semver>

Call git to list tags

Parameters:

  • repo_url (String)

    The URL of the dependency’s repository

Returns:

  • (Array<SpmVersionUpdates::Semver>)

Raises:

  • (GitOperations::LsRemoteError)

    if the lookup fails after retries



34
35
36
# File 'lib/spm_version_updates/git.rb', line 34

def self.version_tags(repo_url)
  GitOperations.version_tags(repo_url)
end