Module: Retest::VersionControl::Git

Defined in:
lib/retest/version_control/git.rb

Class Method Summary collapse

Class Method Details

.diff_files(branch) ⇒ Object



19
20
21
# File 'lib/retest/version_control/git.rb', line 19

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

.filesObject



15
16
17
# File 'lib/retest/version_control/git.rb', line 15

def files
  (untracked_files + tracked_files).sort
end

.installed?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/retest/version_control/git.rb', line 7

def installed?
  system "git -C . rev-parse 2>/dev/null"
end

.nameObject



11
12
13
# File 'lib/retest/version_control/git.rb', line 11

def name
  'git'
end

.tracked_filesObject



27
28
29
# File 'lib/retest/version_control/git.rb', line 27

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

.untracked_filesObject



23
24
25
# File 'lib/retest/version_control/git.rb', line 23

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