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



32
33
34
# File 'lib/libdolt/git.rb', line 32

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

.binary=(path) ⇒ Object



36
37
38
# File 'lib/libdolt/git.rb', line 36

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

.git(git_dir, command) ⇒ Object



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

def self.git(git_dir, command)
  shell('/bin/sh', '-c', "#{binary} --git-dir #{git_dir} #{command}")
end

.git_repo?(path) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/libdolt/git.rb', line 40

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

.shell(*command_with_args) ⇒ Object



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

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