summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaito <saitowu@gmail.com>2012-05-30 12:11:03 +0800
committerSaito <saitowu@gmail.com>2012-05-30 12:11:03 +0800
commitc62715acc920f92ce2f3febf4dc3f838e3097410 (patch)
tree1bd7abc5648812c540d28565d71cf023bf39c703
parent34cc38b6f5942523820ce239b1d5877b0a97e25e (diff)
downloadgitlab-ce-c62715acc920f92ce2f3febf4dc3f838e3097410.tar.gz
now render the correct authorname and message
-rw-r--r--config/initializers/gitlabhq/20_grit_ext.rb21
-rw-r--r--lib/graph_commit.rb4
2 files changed, 2 insertions, 23 deletions
diff --git a/config/initializers/gitlabhq/20_grit_ext.rb b/config/initializers/gitlabhq/20_grit_ext.rb
index 314553f7951..ad8ea1058f0 100644
--- a/config/initializers/gitlabhq/20_grit_ext.rb
+++ b/config/initializers/gitlabhq/20_grit_ext.rb
@@ -13,27 +13,6 @@ Grit::Blob.class_eval do
end
end
-Grit::Commit.class_eval do
- def to_hash
- {
- 'id' => id,
- 'parents' => parents.map { |p| { 'id' => p.id } },
- 'tree' => tree.id,
- 'message' => Gitlab::Encode.utf8(message),
- 'author' => {
- 'name' => Gitlab::Encode.utf8(author.name),
- 'email' => author.email
- },
- 'committer' => {
- 'name' => Gitlab::Encode.utf8(committer.name),
- 'email' => committer.email
- },
- 'authored_date' => authored_date.xmlschema,
- 'committed_date' => committed_date.xmlschema,
- }
- end
-end
-
Grit::Diff.class_eval do
def old_path
Gitlab::Encode.utf8 @a_path
diff --git a/lib/graph_commit.rb b/lib/graph_commit.rb
index 54550d99cf6..64498d8b1d6 100644
--- a/lib/graph_commit.rb
+++ b/lib/graph_commit.rb
@@ -96,13 +96,13 @@ class GraphCommit
h[:parents] = self.parents.collect do |p|
[p.id,0,0]
end
- h[:author] = author.name
+ h[:author] = Gitlab::Encode.utf8(author.name)
h[:time] = time
h[:space] = space
h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil?
h[:id] = sha
h[:date] = date
- h[:message] = message
+ h[:message] = Gitlab::Encode.utf8(message)
h[:login] = author.email
h
end