Class: LastHit::RcAdapter::GitAdapter

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

Class Method Summary collapse

Class Method Details

.get_current_branch_files(another_branch) ⇒ Object



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

def get_current_branch_files(another_branch)
  current_sha = current_commit_sha
  ancestor_sha = common_ancestor(current_branch, another_branch)

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

.get_modified_filesObject



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

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