Class: LastHit::RcAdapter::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/last_hit/rc_adapter/git.rb

Class Method Summary collapse

Class Method Details

.current_branch_files(base_branch) ⇒ Object



9
10
11
12
13
14
# File 'lib/last_hit/rc_adapter/git.rb', line 9

def current_branch_files(base_branch)
  current_sha = current_commit_sha
  ancestor_sha = common_ancestor(current_branch, base_branch)

  `git diff --name-only #{current_sha} #{ancestor_sha} -z`.split("\x0")
end

.modified_filesObject



5
6
7
# File 'lib/last_hit/rc_adapter/git.rb', line 5

def modified_files
  `git status -z`.split("\x0").map { |line| line.split(" ").last }
end