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
24c491ed
Unverified
Commit
24c491ed
authored
Aug 02, 2019
by
Patrick Steinhardt
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5146 from scottfurry/StaticFixesExamples
Adjust printf specifiers in examples code
parents
d588de7c
73a186f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
examples/clone.c
+2
-2
examples/fetch.c
+4
-4
examples/index-pack.c
+2
-2
No files found.
examples/clone.c
View file @
24c491ed
...
...
@@ -23,11 +23,11 @@ static void print_progress(const progress_data *pd)
if
(
pd
->
fetch_progress
.
total_objects
&&
pd
->
fetch_progress
.
received_objects
==
pd
->
fetch_progress
.
total_objects
)
{
printf
(
"Resolving deltas %
d/%d
\r
"
,
printf
(
"Resolving deltas %
u/%u
\r
"
,
pd
->
fetch_progress
.
indexed_deltas
,
pd
->
fetch_progress
.
total_deltas
);
}
else
{
printf
(
"net %3d%% (%4"
PRIuZ
" kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4"
PRIuZ
"/%4"
PRIuZ
")
%s
\n
"
,
printf
(
"net %3d%% (%4"
PRIuZ
" kb, %5u/%5u) / idx %3d%% (%5u/%5u) / chk %3d%% (%4"
PRIuZ
"/%4"
PRIuZ
")
%s
\n
"
,
network_percent
,
kbytes
,
pd
->
fetch_progress
.
received_objects
,
pd
->
fetch_progress
.
total_objects
,
index_percent
,
pd
->
fetch_progress
.
indexed_objects
,
pd
->
fetch_progress
.
total_objects
,
...
...
examples/fetch.c
View file @
24c491ed
...
...
@@ -43,10 +43,10 @@ static int transfer_progress_cb(const git_indexer_progress *stats, void *payload
(
void
)
payload
;
if
(
stats
->
received_objects
==
stats
->
total_objects
)
{
printf
(
"Resolving deltas %
d/%d
\r
"
,
printf
(
"Resolving deltas %
u/%u
\r
"
,
stats
->
indexed_deltas
,
stats
->
total_deltas
);
}
else
if
(
stats
->
total_objects
>
0
)
{
printf
(
"Received %
d/%d objects (%d
) in %"
PRIuZ
" bytes
\r
"
,
printf
(
"Received %
u/%u objects (%u
) in %"
PRIuZ
" bytes
\r
"
,
stats
->
received_objects
,
stats
->
total_objects
,
stats
->
indexed_objects
,
stats
->
received_bytes
);
}
...
...
@@ -92,10 +92,10 @@ int lg2_fetch(git_repository *repo, int argc, char **argv)
*/
stats
=
git_remote_stats
(
remote
);
if
(
stats
->
local_objects
>
0
)
{
printf
(
"
\r
Received %
d/%d objects in %"
PRIuZ
" bytes (used %d
local objects)
\n
"
,
printf
(
"
\r
Received %
u/%u objects in %"
PRIuZ
" bytes (used %u
local objects)
\n
"
,
stats
->
indexed_objects
,
stats
->
total_objects
,
stats
->
received_bytes
,
stats
->
local_objects
);
}
else
{
printf
(
"
\r
Received %
d/%d
objects in %"
PRIuZ
"bytes
\n
"
,
printf
(
"
\r
Received %
u/%u
objects in %"
PRIuZ
"bytes
\n
"
,
stats
->
indexed_objects
,
stats
->
total_objects
,
stats
->
received_bytes
);
}
...
...
examples/index-pack.c
View file @
24c491ed
...
...
@@ -7,7 +7,7 @@
static
int
index_cb
(
const
git_indexer_progress
*
stats
,
void
*
data
)
{
(
void
)
data
;
printf
(
"
\r
Processing %
d of %d
"
,
stats
->
indexed_objects
,
stats
->
total_objects
);
printf
(
"
\r
Processing %
u of %u
"
,
stats
->
indexed_objects
,
stats
->
total_objects
);
return
0
;
}
...
...
@@ -59,7 +59,7 @@ int lg2_index_pack(git_repository *repo, int argc, char **argv)
if
((
error
=
git_indexer_commit
(
idx
,
&
stats
))
<
0
)
goto
cleanup
;
printf
(
"
\r
Indexing %
d of %d
\n
"
,
stats
.
indexed_objects
,
stats
.
total_objects
);
printf
(
"
\r
Indexing %
u of %u
\n
"
,
stats
.
indexed_objects
,
stats
.
total_objects
);
git_oid_fmt
(
hash
,
git_indexer_hash
(
idx
));
puts
(
hash
);
...
...
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