BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dbaed90c
Commit
dbaed90c
authored
Sep 04, 2017
by
micael.bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix refactoring error with Blob.binary?
remove some lint
parent
5625b0e4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
encoding_helper.rb
lib/gitlab/encoding_helper.rb
+2
-2
blob.rb
lib/gitlab/git/blob.rb
+4
-4
diff.rb
lib/gitlab/git/diff.rb
+1
-1
No files found.
lib/gitlab/encoding_helper.rb
View file @
dbaed90c
...
...
@@ -33,12 +33,12 @@ module Gitlab
# encode and clean the bad chars
message
.
replace
clean
(
message
)
rescue
=>
e
rescue
encoding
=
detect
?
detect
[:
encoding
]
:
"unknown"
"--broken encoding:
#{
encoding
}
"
end
def
all_binary?
(
data
,
detect
=
nil
)
def
all_binary?
(
data
,
detect
=
nil
)
detect
||=
CharlockHolmes
::
EncodingDetector
.
detect
(
data
)
detect
&&
detect
[
:type
]
==
:binary
end
...
...
lib/gitlab/git/blob.rb
View file @
dbaed90c
...
...
@@ -57,6 +57,10 @@ module Gitlab
end
end
def
binary?
(
data
)
EncodingHelper
.
libgit2_binary?
(
data
)
end
private
# Recursive search of blob id by path
...
...
@@ -161,10 +165,6 @@ module Gitlab
end
end
end
def
binary?
(
data
)
EncodingHelper
.
libgit2_binary?
(
data
)
end
end
def
initialize
(
options
)
...
...
lib/gitlab/git/diff.rb
View file @
dbaed90c
...
...
@@ -201,7 +201,7 @@ module Gitlab
return
@diff
unless
all_binary?
(
@diff
)
# the diff is binary, let's make a message for it
Diff
::
binary_message
(
@old_path
,
@new_path
)
Diff
.
binary_message
(
@old_path
,
@new_path
)
end
private
...
...
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