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
72806f4c
Commit
72806f4c
authored
Sep 23, 2015
by
Edward Thomson
Committed by
Edward Thomson
May 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch: don't print some headers on pure renames
parent
82175084
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
src/diff_print.c
+13
-4
No files found.
src/diff_print.c
View file @
72806f4c
...
...
@@ -349,6 +349,8 @@ int git_diff_delta__format_file_header(
const
char
*
newpfx
,
int
oid_strlen
)
{
bool
skip_index
;
if
(
!
oldpfx
)
oldpfx
=
DIFF_OLD_PREFIX_DEFAULT
;
if
(
!
newpfx
)
...
...
@@ -364,11 +366,18 @@ int git_diff_delta__format_file_header(
if
(
delta
->
status
==
GIT_DELTA_RENAMED
)
GITERR_CHECK_ERROR
(
diff_delta_format_rename_header
(
out
,
delta
));
GITERR_CHECK_ERROR
(
diff_print_oid_range
(
out
,
delta
,
oid_strlen
));
skip_index
=
(
delta
->
status
==
GIT_DELTA_RENAMED
&&
delta
->
similarity
==
100
&&
delta
->
old_file
.
mode
==
0
&&
delta
->
new_file
.
mode
==
0
);
if
(
!
skip_index
)
{
GITERR_CHECK_ERROR
(
diff_print_oid_range
(
out
,
delta
,
oid_strlen
));
if
((
delta
->
flags
&
GIT_DIFF_FLAG_BINARY
)
==
0
)
diff_delta_format_with_paths
(
out
,
delta
,
oldpfx
,
newpfx
,
"--- %s%s
\n
+++ %s%s
\n
"
);
if
((
delta
->
flags
&
GIT_DIFF_FLAG_BINARY
)
==
0
)
diff_delta_format_with_paths
(
out
,
delta
,
oldpfx
,
newpfx
,
"--- %s%s
\n
+++ %s%s
\n
"
);
}
return
git_buf_oom
(
out
)
?
-
1
:
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