summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-08-16 10:55:28 +0200
committerPatrick Steinhardt <ps@pks.im>2016-10-10 09:04:42 +0200
commit7314da105532306dad21843c8997b746b02fa3ed (patch)
tree7958e08929039ca3538372fe5f02548e61cf8a2a
parente2d1b7ecbf2896b23459bee4b8c3dfe94c091ad5 (diff)
downloadlibgit2-7314da105532306dad21843c8997b746b02fa3ed.tar.gz
examples: fix warnings in network/fetch.c
-rw-r--r--examples/network/fetch.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index 177359b88..10974a9f1 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -55,6 +55,8 @@ static int update_cb(const char *refname, const git_oid *a, const git_oid *b, vo
*/
static int transfer_progress_cb(const git_transfer_progress *stats, void *payload)
{
+ (void)payload;
+
if (stats->received_objects == stats->total_objects) {
printf("Resolving deltas %d/%d\r",
stats->indexed_deltas, stats->total_deltas);
@@ -71,7 +73,6 @@ int fetch(git_repository *repo, int argc, char **argv)
{
git_remote *remote = NULL;
const git_transfer_progress *stats;
- struct dl_data data;
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
if (argc < 2) {
@@ -79,14 +80,13 @@ int fetch(git_repository *repo, int argc, char **argv)
return EXIT_FAILURE;
}
- // Figure out whether it's a named remote or a URL
+ /* Figure out whether it's a named remote or a URL */
printf("Fetching %s for repo %p\n", argv[1], repo);
- if (git_remote_lookup(&remote, repo, argv[1]) < 0) {
+ if (git_remote_lookup(&remote, repo, argv[1]) < 0)
if (git_remote_create_anonymous(&remote, repo, argv[1]) < 0)
- return -1;
- }
+ goto on_error;
- // Set up the callbacks (only update_tips for now)
+ /* Set up the callbacks (only update_tips for now) */
fetch_opts.callbacks.update_tips = &update_cb;
fetch_opts.callbacks.sideband_progress = &progress_cb;
fetch_opts.callbacks.transfer_progress = transfer_progress_cb;
@@ -98,7 +98,7 @@ int fetch(git_repository *repo, int argc, char **argv)
* "fetch".
*/
if (git_remote_fetch(remote, NULL, &fetch_opts, "fetch") < 0)
- return -1;
+ goto on_error;
/**
* If there are local objects (we got a thin pack), then tell