Sha256: f767602197c8b053f55c7600ba8c2723778f47165a0b86b3cc9503ff2fdd9485

Contents?: true

Size: 589 Bytes

Versions: 16

Compression:

Stored size: 589 Bytes

Contents

class Retest::VersionControl
  class Git
    def self.installed?
      system "git -C . rev-parse 2>/dev/null"
    end

    def self.diff_files(branch)
      new.diff_files(branch)
    end

    def name
      'git'
    end

    def files
      (untracked_files + tracked_files).sort
    end

    def diff_files(branch)
      `git diff #{branch} --name-only --diff-filter=ACMRT -z`.split("\x0")
    end

    private

    def untracked_files
      `git ls-files --other --exclude-standard -z`.split("\x0")
    end

    def tracked_files
      `git ls-files -z`.split("\x0")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
retest-1.10.0 lib/retest/version_control/git.rb
retest-1.9.0 lib/retest/version_control/git.rb
retest-1.8.0 lib/retest/version_control/git.rb
retest-1.7.0 lib/retest/version_control/git.rb
retest-1.6.2 lib/retest/version_control/git.rb
retest-1.6.1 lib/retest/version_control/git.rb
retest-1.6.0 lib/retest/version_control/git.rb
retest-1.5.0 lib/retest/version_control/git.rb
retest-1.4.0 lib/retest/version_control/git.rb
retest-1.3.0 lib/retest/version_control/git.rb
retest-1.3.0.pre lib/retest/version_control/git.rb
retest-1.2.0 lib/retest/version_control/git.rb
retest-1.1.0 lib/retest/version_control/git.rb
retest-1.0.0 lib/retest/version_control/git.rb
retest-1.0.0.pre2 lib/retest/version_control/git.rb
retest-1.0.0.pre lib/retest/version_control/git.rb