lib/danger/scm_source/git_repo.rb in danger-additional-logging-0.0.15 vs lib/danger/scm_source/git_repo.rb in danger-additional-logging-0.0.16
- old
+ new
@@ -16,10 +16,12 @@
ensure_commitish_exists!(to)
merge_base = find_merge_base(repo, from, to)
commits_in_branch_count = commits_in_branch_count(from, to)
+ puts "commits_in_branch_count #{commits_in_branch_count}"
+
self.diff = repo.diff(merge_base, to)
self.log = repo.log(commits_in_branch_count).between(from, to)
end
def renamed_files
@@ -137,11 +139,11 @@
def commit_exists?(sha1)
!commit_not_exists?(sha1)
end
def commit_not_exists?(sha1)
- exec("rev-parse --quiet --verify #{sha1}^{commit}").empty?
+ exec("rev-parse --quiet --verify #{sha1}^{commit}", true).empty?
end
def find_merge_base(repo, from, to)
puts "find_merge_base(from=#{from}, to=#{to})"
@@ -177,17 +179,15 @@
end
end
def possible_merge_base(repo, from, to)
puts "possible_merge_base(from=#{from}, to=#{to})"
- exec("--no-pager log #{from} -n 50", true)
- exec("--no-pager log #{to} -n 50", true)
[repo.merge_base(from, to)].find { |base| commit_exists?(base) }
end
def commits_in_branch_count(from, to)
- exec("rev-list #{from}..#{to} --count").to_i
+ exec("rev-list #{from}..#{to} --count", true).to_i
end
def commit_is_ref?(commit)
/[a-f0-9]{5,40}/ !~ commit
end