summaryrefslogtreecommitdiff
path: root/examples/network/git2.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/git2.c')
-rw-r--r--examples/network/git2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/network/git2.c b/examples/network/git2.c
index c694762a2..7c02305c4 100644
--- a/examples/network/git2.c
+++ b/examples/network/git2.c
@@ -25,16 +25,17 @@ 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
fprintf(stderr, "Bad news:\n %s\n", giterr_last()->message);
+ }
if(repo)
git_repository_free(repo);