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
3de22567
Commit
3de22567
authored
Dec 27, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings in example
parent
592f466c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
examples/network/clone.c
+15
-3
No files found.
examples/network/clone.c
View file @
3de22567
...
...
@@ -7,6 +7,16 @@
#include <pthread.h>
#include <unistd.h>
/* Shamelessly borrowed from http://stackoverflow.com/questions/3417837/ */
#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x)
/*@unused@*/
x
#else
# define UNUSED(x) x
#endif
typedef
struct
progress_data
{
git_transfer_progress
fetch_progress
;
size_t
completed_steps
;
...
...
@@ -47,7 +57,10 @@ static void checkout_progress(const char *path, size_t cur, size_t tot, void *pa
print_progress
(
pd
);
}
static
int
cred_acquire
(
git_cred
**
out
,
const
char
*
url
,
unsigned
int
allowed_types
,
void
*
payload
)
static
int
cred_acquire
(
git_cred
**
out
,
const
char
*
UNUSED
(
url
),
unsigned
int
UNUSED
(
allowed_types
),
void
*
UNUSED
(
payload
))
{
char
username
[
128
]
=
{
0
};
char
password
[
128
]
=
{
0
};
...
...
@@ -64,9 +77,8 @@ static int cred_acquire(git_cred **out, const char *url, unsigned int allowed_ty
int
do_clone
(
git_repository
*
repo
,
int
argc
,
char
**
argv
)
{
progress_data
pd
=
{
0
};
progress_data
pd
=
{
{
0
}
};
git_repository
*
cloned_repo
=
NULL
;
git_remote
*
origin
;
git_clone_options
clone_opts
=
GIT_CLONE_OPTIONS_INIT
;
git_checkout_opts
checkout_opts
=
GIT_CHECKOUT_OPTS_INIT
;
const
char
*
url
=
argv
[
1
];
...
...
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