diff --git a/lib/git_stats/git_data/blob.rb b/lib/git_stats/git_data/blob.rb index e824d98f93..7a21dfbac9 100644 --- a/lib/git_stats/git_data/blob.rb +++ b/lib/git_stats/git_data/blob.rb @@ -22,7 +22,7 @@ def extension end def binary? - repo.run("git cat-file blob #{self.sha} | grep -m 1 '^'") =~ /Binary file/ + repo.run("git cat-file blob #{self.sha} | grep '^' | head -1") =~ /Binary file/ end def to_s diff --git a/lib/git_stats/git_data/command_parser.rb b/lib/git_stats/git_data/command_parser.rb index 756fd6a0ec..f7a3d4e719 100644 --- a/lib/git_stats/git_data/command_parser.rb +++ b/lib/git_stats/git_data/command_parser.rb @@ -23,7 +23,7 @@ def parse_ls_tree(result, params) def parse_rev_list(result, params) result.lines.map do |line| - sha, stamp, date, author_email = line.split('|').map(&:strip) + sha, stamp, date, author_email = line.split('~').map(&:strip) {sha: sha, stamp: stamp, date: date, author_email: author_email} end end diff --git a/lib/git_stats/git_data/repo.rb b/lib/git_stats/git_data/repo.rb index 6b61381c8c..a94eba3bb8 100644 --- a/lib/git_stats/git_data/repo.rb +++ b/lib/git_stats/git_data/repo.rb @@ -23,7 +23,9 @@ def authors end def commits - @commits ||= run_and_parse("git rev-list --pretty=format:'%h|%at|%ai|%aE' #{commit_range} | grep -v commit").map do |commit_line| + return @commits if @commits + command = "git rev-list --pretty=format:%h~%at~%ai~%aE #{commit_range} | grep -v commit" + @commits ||= run_and_parse(command).map do |commit_line| Commit.new( repo: self, sha: commit_line[:sha], diff --git a/lib/git_stats/stats_view/view.rb b/lib/git_stats/stats_view/view.rb index 42e216ba22..a8e6051994 100644 --- a/lib/git_stats/stats_view/view.rb +++ b/lib/git_stats/stats_view/view.rb @@ -28,7 +28,7 @@ def render_authors output = Template.new(template, @layout).render(@view_data, author: author, links: links, - active_page: "/authors/#{author.dirname}/#{template}") + active_page: "authors/#{author.dirname}/#{template}") write(output, "#@out_path/authors/#{author.dirname}/#{template}.html") end end