Class: GitHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-allowlist/helpers/git.rb

Overview

For execute git commands

Class Method Summary collapse

Class Method Details

.clone_from_branch(url, destination, branch) ⇒ Object

Download from a specific branch



6
7
8
# File 'lib/cocoapods-allowlist/helpers/git.rb', line 6

def self.clone_from_branch(url, destination, branch)
    Command.execute("git clone --quiet --depth 1 -b #{branch} --single-branch #{url} #{destination}")
end

.get_latest_commit(directory) ⇒ Object

Get the latest commit hash



11
12
13
14
15
# File 'lib/cocoapods-allowlist/helpers/git.rb', line 11

def self.get_latest_commit(directory)
    Dir.chdir(directory) do
        Command.execute("git rev-parse HEAD").strip
    end
end