Sha256: a902ca05434ba254ab1f64be1e122b349fc6aa1761ccb714fd1b422ab0853cfc

Contents?: true

Size: 437 Bytes

Versions: 5

Compression:

Stored size: 437 Bytes

Contents

require 'git'
# TestDiff module
module TestDiff
  # module for version control adapters
  module VersionControl
    # class to find changed files for git
    class Git
      def initialize(wd, last_tracked, current = 'HEAD')
        @git = ::Git.open(wd)
        @last_tracked = last_tracked
        @current = current
      end

      def changed_files
        @git.diff(@last_tracked, @current).map(&:path)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
test_diff-0.3.4 lib/test_diff/version_control/git.rb
test_diff-0.3.3 lib/test_diff/version_control/git.rb
test_diff-0.3.2 lib/test_diff/version_control/git.rb
test_diff-0.3.1 lib/test_diff/version_control/git.rb
test_diff-0.3.0 lib/test_diff/version_control/git.rb