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
a8d0b4de
Commit
a8d0b4de
authored
Sep 25, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3439 from bisho/master
Fix binary diffs
parents
588e28eb
e4b2b919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
src/diff_print.c
+1
-1
tests/diff/binary.c
+14
-7
No files found.
src/diff_print.c
View file @
a8d0b4de
...
@@ -358,6 +358,7 @@ static int format_binary(
...
@@ -358,6 +358,7 @@ static int format_binary(
scan
+=
chunk_len
;
scan
+=
chunk_len
;
pi
->
line
.
num_lines
++
;
pi
->
line
.
num_lines
++
;
}
}
git_buf_putc
(
pi
->
buf
,
'\n'
);
return
0
;
return
0
;
}
}
...
@@ -416,7 +417,6 @@ static int diff_print_patch_file_binary(
...
@@ -416,7 +417,6 @@ static int diff_print_patch_file_binary(
if
((
error
=
format_binary
(
pi
,
binary
->
new_file
.
type
,
binary
->
new_file
.
data
,
if
((
error
=
format_binary
(
pi
,
binary
->
new_file
.
type
,
binary
->
new_file
.
data
,
binary
->
new_file
.
datalen
,
binary
->
new_file
.
inflatedlen
))
<
0
||
binary
->
new_file
.
datalen
,
binary
->
new_file
.
inflatedlen
))
<
0
||
(
error
=
git_buf_putc
(
pi
->
buf
,
'\n'
))
<
0
||
(
error
=
format_binary
(
pi
,
binary
->
old_file
.
type
,
binary
->
old_file
.
data
,
(
error
=
format_binary
(
pi
,
binary
->
old_file
.
type
,
binary
->
old_file
.
data
,
binary
->
old_file
.
datalen
,
binary
->
old_file
.
inflatedlen
))
<
0
)
{
binary
->
old_file
.
datalen
,
binary
->
old_file
.
inflatedlen
))
<
0
)
{
...
...
tests/diff/binary.c
View file @
a8d0b4de
...
@@ -96,7 +96,8 @@ void test_diff_binary__add(void)
...
@@ -96,7 +96,8 @@ void test_diff_binary__add(void)
"Kc${Nk-~s>u4FC%O
\n
"
"Kc${Nk-~s>u4FC%O
\n
"
"
\n
"
\
"
\n
"
\
"literal 0
\n
"
\
"literal 0
\n
"
\
"Hc$@<O00001
\n
"
;
"Hc$@<O00001
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
@@ -136,7 +137,8 @@ void test_diff_binary__modify(void)
...
@@ -136,7 +137,8 @@ void test_diff_binary__modify(void)
"Mc${NkU}WL~000&M4gdfE
\n
"
\
"Mc${NkU}WL~000&M4gdfE
\n
"
\
"
\n
"
\
"
\n
"
\
"literal 3
\n
"
\
"literal 3
\n
"
\
"Kc${Nk-~s>u4FC%O
\n
"
;
"Kc${Nk-~s>u4FC%O
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
...
@@ -177,7 +179,8 @@ void test_diff_binary__delete(void)
...
@@ -177,7 +179,8 @@ void test_diff_binary__delete(void)
"Hc$@<O00001
\n
"
\
"Hc$@<O00001
\n
"
\
"
\n
"
\
"
\n
"
\
"literal 3
\n
"
\
"literal 3
\n
"
\
"Kc${Nk-~s>u4FC%O
\n
"
;
"Kc${Nk-~s>u4FC%O
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
@@ -208,7 +211,8 @@ void test_diff_binary__delta(void)
...
@@ -208,7 +211,8 @@ void test_diff_binary__delta(void)
"delta 198
\n
"
\
"delta 198
\n
"
\
"zc$}LmI8{(0BqLQJI6p64AwNwaIJGP_Pr*5}Br~;mqJ$<Jl;sX*mF<MGCYv&*L7AHu
\n
"
\
"zc$}LmI8{(0BqLQJI6p64AwNwaIJGP_Pr*5}Br~;mqJ$<Jl;sX*mF<MGCYv&*L7AHu
\n
"
\
"zGA1*^gt?gYVN82wTbPO_W)+x<&1+cP;HrPHR>PQ;Y(X&QMK*C5^Br3bjG4d=XI^5@
\n
"
\
"zGA1*^gt?gYVN82wTbPO_W)+x<&1+cP;HrPHR>PQ;Y(X&QMK*C5^Br3bjG4d=XI^5@
\n
"
\
"JfH567LIF3FM2!Fd
\n
"
;
"JfH567LIF3FM2!Fd
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
@@ -249,7 +253,8 @@ void test_diff_binary__delta_append(void)
...
@@ -249,7 +253,8 @@ void test_diff_binary__delta_append(void)
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"
\n
"
\
"
\n
"
\
"delta 7
\n
"
\
"delta 7
\n
"
\
"Oc%18D`@*{63ljhg(E~C7
\n
"
;
"Oc%18D`@*{63ljhg(E~C7
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
@@ -314,7 +319,8 @@ void test_diff_binary__index_to_workdir(void)
...
@@ -314,7 +319,8 @@ void test_diff_binary__index_to_workdir(void)
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"
\n
"
\
"
\n
"
\
"delta 7
\n
"
\
"delta 7
\n
"
\
"Oc%18D`@*{63ljhg(E~C7
\n
"
;
"Oc%18D`@*{63ljhg(E~C7
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
@@ -379,7 +385,8 @@ void test_diff_binary__print_patch_from_diff(void)
...
@@ -379,7 +385,8 @@ void test_diff_binary__print_patch_from_diff(void)
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"
\n
"
\
"
\n
"
\
"delta 7
\n
"
\
"delta 7
\n
"
\
"Oc%18D`@*{63ljhg(E~C7
\n
"
;
"Oc%18D`@*{63ljhg(E~C7
\n
"
\
"
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
...
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