summaryrefslogtreecommitdiff
path: root/examples/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/git2.c4
-rw-r--r--examples/network/index-pack.c6
-rw-r--r--examples/network/ls-remote.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/examples/network/git2.c b/examples/network/git2.c
index d6ea419c4..7c02305c4 100644
--- a/examples/network/git2.c
+++ b/examples/network/git2.c
@@ -25,12 +25,12 @@ int run_command(git_cb fn, int argc, char **argv)
// repository and pass it to the function.
error = git_repository_open(&repo, ".git");
- if (error < GIT_SUCCESS)
+ if (error < 0)
repo = NULL;
// Run the command. If something goes wrong, print the error message to stderr
error = fn(repo, argc, argv);
- if (error < GIT_SUCCESS) {
+ if (error < 0) {
if (giterr_last() == NULL)
fprintf(stderr, "Error without message");
else
diff --git a/examples/network/index-pack.c b/examples/network/index-pack.c
index 881c1493f..03f3ae37e 100644
--- a/examples/network/index-pack.c
+++ b/examples/network/index-pack.c
@@ -80,13 +80,13 @@ int index_pack_old(git_repository *repo, int argc, char **argv)
// Create a new indexer
error = git_indexer_new(&indexer, argv[1]);
- if (error < GIT_SUCCESS)
+ if (error < 0)
return error;
// Index the packfile. This function can take a very long time and
// should be run in a worker thread.
error = git_indexer_run(indexer, &stats);
- if (error < GIT_SUCCESS)
+ if (error < 0)
return error;
// Write the information out to an index file
@@ -98,5 +98,5 @@ int index_pack_old(git_repository *repo, int argc, char **argv)
git_indexer_free(indexer);
- return GIT_SUCCESS;
+ return 0;
}
diff --git a/examples/network/ls-remote.c b/examples/network/ls-remote.c
index 958a88651..39cc64725 100644
--- a/examples/network/ls-remote.c
+++ b/examples/network/ls-remote.c
@@ -9,7 +9,7 @@ static int show_ref__cb(git_remote_head *head, void *payload)
char oid[GIT_OID_HEXSZ + 1] = {0};
git_oid_fmt(oid, &head->oid);
printf("%s\t%s\n", oid, head->name);
- return GIT_SUCCESS;
+ return 0;
}
int use_unnamed(git_repository *repo, const char *url)
@@ -20,13 +20,13 @@ int use_unnamed(git_repository *repo, const char *url)
// Create an instance of a remote from the URL. The transport to use
// is detected from the URL
error = git_remote_new(&remote, repo, NULL, url, NULL);
- if (error < GIT_SUCCESS)
+ if (error < 0)
goto cleanup;
// When connecting, the underlying code needs to know wether we
// want to push or fetch
error = git_remote_connect(remote, GIT_DIR_FETCH);
- if (error < GIT_SUCCESS)
+ if (error < 0)
goto cleanup;
// With git_remote_ls we can retrieve the advertised heads
@@ -44,11 +44,11 @@ int use_remote(git_repository *repo, char *name)
// Find the remote by name
error = git_remote_load(&remote, repo, name);
- if (error < GIT_SUCCESS)
+ if (error < 0)
goto cleanup;
error = git_remote_connect(remote, GIT_DIR_FETCH);
- if (error < GIT_SUCCESS)
+ if (error < 0)
goto cleanup;
error = git_remote_ls(remote, &show_ref__cb, NULL);