Class: Grit::Repo

Inherits:
Object show all
Defined in:
lib/transparent_git/repo.rb

Instance Method Summary collapse

Instance Method Details

#changes(ops) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/transparent_git/repo.rb', line 53

def changes(ops)
  branch = ops[:branch] || 'master'
  num_commits = ops[:end] - ops[:start] + 1
  cs = commits(branch,num_commits,ops[:start])
  cs = cs.reject { |x| bad_commit_hashes.include?(x.id) }
  cs.map { |x| changes_for_commit(x) }.flatten
end

#changes_for_commit(commit) ⇒ Object



31
32
33
34
35
# File 'lib/transparent_git/repo.rb', line 31

def changes_for_commit(commit)
  commit.diffs.map do |diff|
    POChange.from_diff(commit,diff)
  end
end

#good_commitsObject



44
45
46
# File 'lib/transparent_git/repo.rb', line 44

def good_commits
  all_commits.reject { |x| bad_commit_hashes.include?(x.id) }
end

#latest_filesObject



47
48
49
50
51
52
# File 'lib/transparent_git/repo.rb', line 47

def latest_files
  t = commits('master',1).first.tree
  res = []
  each_tree_file(t) { |name,blob| res << RepoFile.new(:file => name, :body => blob.data.stripped_chars) }
  res
end