Module: Dolt::Git

Defined in:
lib/libdolt/git.rb,
lib/libdolt/git/tree.rb,
lib/libdolt/git/blame.rb,
lib/libdolt/git/commit.rb,
lib/libdolt/git/process.rb,
lib/libdolt/git/archiver.rb,
lib/libdolt/git/submodule.rb,
lib/libdolt/git/repository.rb

Defined Under Namespace

Classes: Archiver, Blame, Commit, InvalidBlameFormat, Process, Repository, Submodule, Tree

Class Method Summary collapse

Class Method Details

.binaryObject



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

def self.binary
  @binary ||= "git"
end

.binary=(path) ⇒ Object



38
39
40
# File 'lib/libdolt/git.rb', line 38

def self.binary=(path)
  @binary = path
end

.git(git_dir, command) ⇒ Object



29
30
31
32
# File 'lib/libdolt/git.rb', line 29

def self.git(git_dir, command)
  args = Shellwords.join(command.split(" "))
  shell("#{binary} --git-dir #{git_dir} #{args}")
end

.git_repo?(path) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
45
# File 'lib/libdolt/git.rb', line 42

def self.git_repo?(path)
  return true if path.split(".").last == "git"
  File.exists?(File.join(path, ".git"))
end

.shell(command) ⇒ Object



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

def self.shell(command)
  stdin, stdout, stderr, wait_thread = Open3.popen3(command)
  Dolt::Git::Process.new(stdin, stdout, stderr, wait_thread)
end