Class: Awestruct::Scm::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/awestruct/scm/git.rb

Instance Method Summary collapse

Instance Method Details

#uncommitted_changes?(source_dir) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
# File 'lib/awestruct/scm/git.rb', line 6

def uncommitted_changes?(source_dir)
  result = Open3.popen3('git status --porcelain', :chdir => source_dir) do |stdin, stdout, stderr, wait_thr|
    stdout.read.chomp =~ /^\s*([AM?]+)/
  end
  !result.nil?
end