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
c8a39f9e
Commit
c8a39f9e
authored
Jun 27, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1684 from libgit2/fix-dirty-submodule-diff
Dirty submodules do not correctly appear in diffs
parents
b0401c68
c67ff958
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
src/diff_patch.c
+5
-1
tests-clar/diff/submodules.c
+3
-1
No files found.
src/diff_patch.c
View file @
c8a39f9e
...
...
@@ -10,6 +10,7 @@
#include "diff_driver.h"
#include "diff_patch.h"
#include "diff_xdiff.h"
#include "fileops.h"
/* cached information about a single span in a diff */
typedef
struct
diff_patch_line
diff_patch_line
;
...
...
@@ -175,9 +176,12 @@ static int diff_patch_load(git_diff_patch *patch, git_diff_output *output)
goto
cleanup
;
}
/* if we were previously missing an oid, update MODIFIED->UNMODIFIED */
/* if previously missing an oid, and now that we have it the two sides
* are the same (and not submodules), update MODIFIED -> UNMODIFIED
*/
if
(
incomplete_data
&&
patch
->
ofile
.
file
->
mode
==
patch
->
nfile
.
file
->
mode
&&
patch
->
ofile
.
file
->
mode
!=
GIT_FILEMODE_COMMIT
&&
git_oid_equal
(
&
patch
->
ofile
.
file
->
oid
,
&
patch
->
nfile
.
file
->
oid
)
&&
patch
->
delta
->
status
==
GIT_DELTA_MODIFIED
)
/* not RENAMED/COPIED! */
patch
->
delta
->
status
=
GIT_DELTA_UNMODIFIED
;
...
...
tests-clar/diff/submodules.c
View file @
c8a39f9e
...
...
@@ -47,8 +47,10 @@ static void check_diff_patches(git_diff_list *diff, const char **expected)
for
(
d
=
0
;
d
<
num_d
;
++
d
,
git_diff_patch_free
(
patch
))
{
cl_git_pass
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
d
));
if
(
delta
->
status
==
GIT_DELTA_UNMODIFIED
)
if
(
delta
->
status
==
GIT_DELTA_UNMODIFIED
)
{
cl_assert
(
expected
[
d
]
==
NULL
);
continue
;
}
if
(
expected
[
d
]
&&
!
strcmp
(
expected
[
d
],
"<SKIP>"
))
continue
;
...
...
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