class DTK::Network::Client::GitClient

Attributes

repo_dir[R]

Public Class Methods

clone(repo_url, target_path, branch) click to toggle source
# File lib/client/git_client.rb, line 15
def self.clone(repo_url, target_path, branch)
  git_adapter_class.clone(repo_url, target_path, branch)
end
is_git_repo?(dir) click to toggle source
# File lib/client/git_client.rb, line 19
def self.is_git_repo?(dir)
  File.directory?("#{dir}/.git")
end
new(repo_dir, opts = {}) click to toggle source

opts can have keys

:branch
# File lib/client/git_client.rb, line 8
def initialize(repo_dir, opts = {})
  @repo_dir    = repo_dir
  @git_adapter = git_adapter_class.new(repo_dir, opts)
end

Private Class Methods

git_adapter_class() click to toggle source
# File lib/client/git_client.rb, line 131
def self.git_adapter_class
  GitGem
end

Public Instance Methods

add_all() click to toggle source
# File lib/client/git_client.rb, line 117
def add_all
  @git_adapter.add_all
end
add_remote(name, url) click to toggle source
# File lib/client/git_client.rb, line 23
def add_remote(name, url)
  @git_adapter.add_remote(name, url)
end
all_branches() click to toggle source
# File lib/client/git_client.rb, line 121
def all_branches
  @git_adapter.all_branches
end
changed?() click to toggle source
# File lib/client/git_client.rb, line 27
def changed?
  @git_adapter.changed?
end
checkout(branch, opts = {}) click to toggle source

opts can have keys

:new_branch - Boolean
# File lib/client/git_client.rb, line 33
def checkout(branch, opts = {})
  @git_adapter.checkout(branch, opts)
end
commit(commit_msg = "", opts = {}) click to toggle source
# File lib/client/git_client.rb, line 93
def commit(commit_msg = "", opts = {})
  @git_adapter.commit(commit_msg, opts)
end
current_branch() click to toggle source
# File lib/client/git_client.rb, line 37
def current_branch
  @git_adapter.current_branch
end
diff() click to toggle source
# File lib/client/git_client.rb, line 41
def diff
  @git_adapter.diff
end
diff_name_status(branch_or_sha_1 = nil, branch_or_sha_2 = nil, opts = {}) click to toggle source
# File lib/client/git_client.rb, line 45
def diff_name_status(branch_or_sha_1 = nil, branch_or_sha_2 = nil, opts = {})
  @git_adapter.diff_name_status(branch_or_sha_1, branch_or_sha_2, opts)
end
empty_commit(commit_msg = nil) click to toggle source
# File lib/client/git_client.rb, line 89
def empty_commit(commit_msg = nil)
  @git_adapter.empty_commit(commit_msg)
end
fetch(remote = 'origin') click to toggle source
# File lib/client/git_client.rb, line 49
def fetch(remote = 'origin')
  @git_adapter.fetch(remote)
end
head_commit_sha() click to toggle source
# File lib/client/git_client.rb, line 53
def head_commit_sha
  @git_adapter.head_commit_sha
end
is_there_remote?(remote_name) click to toggle source
# File lib/client/git_client.rb, line 57
def is_there_remote?(remote_name)
  @git_adapter.is_there_remote?(remote_name)
end
local_ahead(base_sha, remote_sha) click to toggle source
# File lib/client/git_client.rb, line 113
def local_ahead(base_sha, remote_sha)
  @git_adapter.local_ahead(base_sha, remote_sha)
end
merge(branch_to_merge_from, opts = {}) click to toggle source
# File lib/client/git_client.rb, line 61
def merge(branch_to_merge_from, opts = {})
  @git_adapter.merge(branch_to_merge_from, opts)
end
pull(remote, branch) click to toggle source
# File lib/client/git_client.rb, line 73
def pull(remote, branch)
  @git_adapter.pull(remote, branch)
end
push(remote, branch, opts = {}) click to toggle source
# File lib/client/git_client.rb, line 65
def push(remote, branch, opts = {})
  @git_adapter.push(remote, branch, opts)
end
push_from_cached_branch(remote, branch, opts = {}) click to toggle source
# File lib/client/git_client.rb, line 69
def push_from_cached_branch(remote, branch, opts = {})
  @git_adapter.push_from_cached_branch(remote, branch, opts)
end
remotes() click to toggle source
# File lib/client/git_client.rb, line 77
def remotes
  @git_adapter.remotes
end
remove_remote(name) click to toggle source
# File lib/client/git_client.rb, line 81
def remove_remote(name)
  @git_adapter.remove_remote(name)
end
reset_hard(sha) click to toggle source
# File lib/client/git_client.rb, line 101
def reset_hard(sha)
  @git_adapter.reset_hard(sha)
end
reset_soft(sha) click to toggle source
# File lib/client/git_client.rb, line 97
def reset_soft(sha)
  @git_adapter.reset_soft(sha)
end
rev_list(base_sha) click to toggle source
# File lib/client/git_client.rb, line 109
def rev_list(base_sha)
  @git_adapter.rev_list(base_sha)
end
revparse(string) click to toggle source
# File lib/client/git_client.rb, line 105
def revparse(string)
  @git_adapter.revparse(string)
end
stage_and_commit(commit_msg = nil) click to toggle source
# File lib/client/git_client.rb, line 85
def stage_and_commit(commit_msg = nil)
  @git_adapter.stage_and_commit(commit_msg)
end

Private Instance Methods

git_adapter_class() click to toggle source
# File lib/client/git_client.rb, line 127
def git_adapter_class
  self.class.git_adapter_class
end