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
8086b78b
Commit
8086b78b
authored
Feb 09, 2014
by
rocky-luo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace 'out' with 'patch',replace the literal tabs with '\t'.
parent
4f5a3f40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
examples/diff.c
+6
-6
No files found.
examples/diff.c
View file @
8086b78b
...
...
@@ -267,7 +267,7 @@ static void parse_opts(struct opts *o, int argc, char *argv[])
/** Display diff output with "--numstat".*/
static
void
diff_print_numstat
(
git_diff
*
diff
)
{
git_patch
*
out
;
git_patch
*
patch
;
const
git_diff_delta
*
delta
;
size_t
i
;
size_t
ndeltas
;
...
...
@@ -275,13 +275,13 @@ static void diff_print_numstat(git_diff *diff)
ndeltas
=
git_diff_num_deltas
(
diff
);
for
(
i
=
0
;
i
<
ndeltas
;
i
++
){
check_lg2
(
git_patch_from_diff
(
&
out
,
diff
,
i
),
git_patch_from_diff
(
&
patch
,
diff
,
i
),
"generating patch from diff"
,
NULL
);
check_lg2
(
git_patch_line_stats
(
NULL
,
&
nadditions
,
&
ndeletions
,
out
),
git_patch_line_stats
(
NULL
,
&
nadditions
,
&
ndeletions
,
patch
),
"generating the number of additions and deletions"
,
NULL
);
delta
=
git_patch_get_delta
(
out
);
printf
(
"%u
%u
%s
\n
"
,
nadditions
,
ndeletions
,
delta
->
new_file
.
path
);
delta
=
git_patch_get_delta
(
patch
);
printf
(
"%u
\t
%u
\t
%s
\n
"
,
nadditions
,
ndeletions
,
delta
->
new_file
.
path
);
}
git_patch_free
(
out
);
git_patch_free
(
patch
);
}
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