diff --git a/app/views/projects/git/commits/_show.html.slim b/app/views/projects/git/commits/_show.html.slim index 6ee3260ec..fa38dfc13 100644 --- a/app/views/projects/git/commits/_show.html.slim +++ b/app/views/projects/git/commits/_show.html.slim @@ -1,6 +1,6 @@ - begin - diffs = @commit.show - - stats = Grit::CommitStats.find_all(@project.repo, @commit.sha, max_count: 1, skip: 0, M: true)[0][-1] + - stats = Grit::CommitStats.find_all(@project.repo, @commit.sha, max_count: 1, skip: 0)[0][-1] = render_commit_stats(stats: stats, diff: @commit.show, repo: @project.repo, commit: @commit) .pull-right diff --git a/lib/ext/git/grit.rb b/lib/ext/git/grit.rb index c8a6fc423..4763e6e00 100644 --- a/lib/ext/git/grit.rb +++ b/lib/ext/git/grit.rb @@ -63,7 +63,7 @@ module Grit end def diff(a, b, *paths) - diff = self.git.native('diff', {M: true}, "#{a}...#{b}", '--', *paths) + diff = self.git.native('diff', {}, "#{a}...#{b}", '--', *paths) if diff =~ /diff --git a/ diff = diff.sub(/.*?(diff --git a)/m, '\1') else @@ -82,7 +82,7 @@ module Grit def diff_stats(a,b) stats = [] Dir.chdir(path) do - lines = self.git.native(:diff, {numstat: true, M: true}, "#{a}...#{b}").split("\n") + lines = self.git.native(:diff, {numstat: true}, "#{a}...#{b}").split("\n") while !lines.empty? files = [] while lines.first =~ /^([-\d]+)\s+([-\d]+)\s+(.+)/