Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d0f00de4
Commit
d0f00de4
authored
May 16, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase binary detection len to 8k
parent
8e1b5a8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
src/blob.c
+2
-1
src/diff_driver.c
+5
-1
src/filter.h
+4
-0
No files found.
src/blob.c
View file @
d0f00de4
...
...
@@ -334,7 +334,8 @@ int git_blob_is_binary(const git_blob *blob)
assert
(
blob
);
content
.
ptr
=
blob
->
odb_object
->
buffer
;
content
.
size
=
min
(
blob
->
odb_object
->
cached
.
size
,
4000
);
content
.
size
=
min
(
blob
->
odb_object
->
cached
.
size
,
GIT_FILTER_BYTES_TO_CHECK_NUL
);
content
.
asize
=
0
;
return
git_buf_text_is_binary
(
&
content
);
...
...
src/diff_driver.c
View file @
d0f00de4
...
...
@@ -397,7 +397,11 @@ void git_diff_driver_update_options(
int
git_diff_driver_content_is_binary
(
git_diff_driver
*
driver
,
const
char
*
content
,
size_t
content_len
)
{
const
git_buf
search
=
{
(
char
*
)
content
,
0
,
min
(
content_len
,
4000
)
};
git_buf
search
;
search
.
ptr
=
(
char
*
)
content
;
search
.
size
=
min
(
content_len
,
GIT_FILTER_BYTES_TO_CHECK_NUL
);
search
.
asize
=
0
;
GIT_UNUSED
(
driver
);
...
...
src/filter.h
View file @
d0f00de4
...
...
@@ -10,6 +10,10 @@
#include "common.h"
#include "git2/filter.h"
/* Amount of file to examine for NUL byte when checking binary-ness */
#define GIT_FILTER_BYTES_TO_CHECK_NUL 8000
/* Possible CRLF values */
typedef
enum
{
GIT_CRLF_GUESS
=
-
1
,
GIT_CRLF_BINARY
=
0
,
...
...
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