def dirty?(path = Dir.pwd)
      g = MiniGit.new(path)
      a = g.capturing.diff :shortstat => true
      #ap a
      !a.empty?
    end
def dirty?(path = Dir.pwd)
      g = MiniGit.new(path)
      a = g.capturing.diff :shortstat => true
      #ap a
      !a.empty?
    end
Check if a git directory is in dirty mode
 git diff --shortstat 2> /dev/null | tail -n1