Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git_stats/git_data/blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/git_stats/git_data/command_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/git_stats/git_data/repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion lib/git_stats/stats_view/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down