Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-05-19 03:46:11 +0400
committerVicent Marti <tanoku@gmail.com>2012-05-19 03:46:11 +0400
commit5b9fac39d8a76b9139667c26a63e6b3f204b3977 (patch)
treee6ba28025f92c16563c4ffa8bc60b95f17d69691 /examples/network/git2.c
parent7ef9f1b5606c2672105ecbbf34c022a71ef212fe (diff)
parentad5df35a47d56c3d716d7a56eac4aeb611987c11 (diff)
Merge branch 'development'v0.17.0
Conflicts: .travis.yml
Diffstat (limited to 'examples/network/git2.c')
-rw-r--r--examples/network/git2.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/network/git2.c b/examples/network/git2.c
index def56e83b..7c02305c4 100644
--- a/examples/network/git2.c
+++ b/examples/network/git2.c
@@ -25,13 +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)
- fprintf(stderr, "Bad news:\n %s\n", git_lasterror());
+ 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);