Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c71a76e7
Commit
c71a76e7
authored
May 30, 2012
by
Saito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix graph problem if authorname or message isnot utf8 encoding
parent
efd9a717
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
config/initializers/gitlabhq/20_grit_ext.rb
config/initializers/gitlabhq/20_grit_ext.rb
+17
-2
lib/graph_commit.rb
lib/graph_commit.rb
+2
-2
No files found.
config/initializers/gitlabhq/20_grit_ext.rb
View file @
c71a76e7
...
...
@@ -14,8 +14,23 @@ Grit::Blob.class_eval do
end
Grit
::
Commit
.
class_eval
do
def
message
Gitlab
::
Encode
.
utf8
@message
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
...
...
lib/graph_commit.rb
View file @
c71a76e7
...
...
@@ -96,13 +96,13 @@ class GraphCommit
h
[
:parents
]
=
self
.
parents
.
collect
do
|
p
|
[
p
.
id
,
0
,
0
]
end
h
[
:author
]
=
author
.
name
.
force_encoding
(
"UTF-8"
)
h
[
:author
]
=
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
.
force_encoding
(
"UTF-8"
)
h
[
:message
]
=
message
h
[
:login
]
=
author
.
email
h
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment