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
ce3b71d9
Commit
ce3b71d9
authored
May 12, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't scale diff stat when not needed
parent
b1914c36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
src/diff_stats.c
+2
-0
tests/diff/stats.c
+4
-0
No files found.
src/diff_stats.c
View file @
ce3b71d9
...
...
@@ -284,6 +284,8 @@ int git_diff_stats_to_buf(
if
(
width
<
STATS_FULL_MIN_SCALE
)
width
=
STATS_FULL_MIN_SCALE
;
}
if
(
width
>
stats
->
max_filestat
)
width
=
0
;
for
(
i
=
0
;
i
<
stats
->
files_changed
;
++
i
)
{
if
((
delta
=
git_diff_get_delta
(
stats
->
diff
,
i
))
==
NULL
)
...
...
tests/diff/stats.c
View file @
ce3b71d9
...
...
@@ -54,6 +54,10 @@ void test_diff_stats__stat(void)
cl_git_pass
(
git_diff_stats_to_buf
(
&
buf
,
_stats
,
GIT_DIFF_STATS_FULL
,
0
));
cl_assert
(
strcmp
(
git_buf_cstr
(
&
buf
),
stat
)
==
0
);
git_buf_free
(
&
buf
);
cl_git_pass
(
git_diff_stats_to_buf
(
&
buf
,
_stats
,
GIT_DIFF_STATS_FULL
,
80
));
cl_assert
(
strcmp
(
git_buf_cstr
(
&
buf
),
stat
)
==
0
);
git_buf_free
(
&
buf
);
}
void
test_diff_stats__multiple_hunks
(
void
)
...
...
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