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
08c45213
Commit
08c45213
authored
Apr 19, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3024 from git-up/diff_merge_fix
Make sure to also update delta->nfiles when merging diffs
parents
4c02d393
b9780823
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/diff_tform.c
+8
-2
No files found.
src/diff_tform.c
View file @
08c45213
...
...
@@ -84,11 +84,14 @@ static git_diff_delta *diff_delta__merge_like_cgit(
* index (i.e. not in HEAD nor workdir) is given as empty.
*/
if
(
dup
->
status
==
GIT_DELTA_DELETED
)
{
if
(
a
->
status
==
GIT_DELTA_ADDED
)
if
(
a
->
status
==
GIT_DELTA_ADDED
)
{
dup
->
status
=
GIT_DELTA_UNMODIFIED
;
dup
->
nfiles
=
2
;
}
/* else don't overwrite DELETE status */
}
else
{
dup
->
status
=
a
->
status
;
dup
->
nfiles
=
a
->
nfiles
;
}
git_oid_cpy
(
&
dup
->
old_file
.
id
,
&
a
->
old_file
.
id
);
...
...
@@ -118,10 +121,13 @@ static git_diff_delta *diff_delta__merge_like_cgit_reversed(
return
dup
;
if
(
dup
->
status
==
GIT_DELTA_DELETED
)
{
if
(
b
->
status
==
GIT_DELTA_ADDED
)
if
(
b
->
status
==
GIT_DELTA_ADDED
)
{
dup
->
status
=
GIT_DELTA_UNMODIFIED
;
dup
->
nfiles
=
2
;
}
}
else
{
dup
->
status
=
b
->
status
;
dup
->
nfiles
=
b
->
nfiles
;
}
git_oid_cpy
(
&
dup
->
old_file
.
id
,
&
b
->
old_file
.
id
);
...
...
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