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
f62c174d
Commit
f62c174d
authored
Dec 02, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better
parent
97ad85b8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
include/git2/diff.h
+2
-2
src/diff_tform.c
+1
-1
tests/diff/rename.c
+1
-1
No files found.
include/git2/diff.h
View file @
f62c174d
...
...
@@ -525,14 +525,14 @@ typedef enum {
*/
GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY
=
(
1u
<<
15
),
/**
Delete any UNMODIFIED record
s after find_similar is done.
/**
Remove any UNMODIFIED delta
s after find_similar is done.
*
* Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the
* --find-copies-harder behavior requires building a diff with the
* GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
* records in the final result, pass this flag to have them removed.
*/
GIT_DIFF_FIND_
DELET
E_UNMODIFIED
=
(
1u
<<
16
),
GIT_DIFF_FIND_
REMOV
E_UNMODIFIED
=
(
1u
<<
16
),
}
git_diff_find_t
;
/**
...
...
src/diff_tform.c
View file @
f62c174d
...
...
@@ -746,7 +746,7 @@ static bool is_rename_source(
case
GIT_DELTA_UNMODIFIED
:
if
(
!
FLAG_SET
(
opts
,
GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED
))
return
false
;
if
(
FLAG_SET
(
opts
,
GIT_DIFF_FIND_
DELET
E_UNMODIFIED
))
if
(
FLAG_SET
(
opts
,
GIT_DIFF_FIND_
REMOV
E_UNMODIFIED
))
delta
->
flags
|=
GIT_DIFF_FLAG__TO_DELETE
;
break
;
...
...
tests/diff/rename.c
View file @
f62c174d
...
...
@@ -1365,7 +1365,7 @@ void test_diff_rename__can_delete_unmodified_deltas(void)
cl_assert_equal_i
(
1
,
exp
.
file_status
[
GIT_DELTA_MODIFIED
]);
cl_assert_equal_i
(
3
,
exp
.
file_status
[
GIT_DELTA_UNMODIFIED
]);
opts
.
flags
=
GIT_DIFF_FIND_ALL
|
GIT_DIFF_FIND_
DELET
E_UNMODIFIED
;
opts
.
flags
=
GIT_DIFF_FIND_ALL
|
GIT_DIFF_FIND_
REMOV
E_UNMODIFIED
;
cl_git_pass
(
git_diff_find_similar
(
diff
,
&
opts
));
memset
(
&
exp
,
0
,
sizeof
(
exp
));
...
...
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