diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-11-18 22:45:56 +0100 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-11-18 22:45:56 +0100 |
commit | bdd31dd5e832126b2f22fccbe244a1106c241ab0 (patch) | |
tree | b08a2ad0fad57131563aa8c071221bea241128c1 /examples | |
parent | 277b7efe493887081ce1dafd91199d0ee9f676c9 (diff) | |
parent | e4c93a392763a006d11e1c1dd01c12f85498dad5 (diff) | |
download | libgit2-error-handling.tar.gz |
Merge branch 'development' into error-handlingerror-handling
The code in this branch has been modified so it works with the global
state introduced in development.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/general.c | 4 | ||||
-rw-r--r-- | examples/network/.gitignore | 1 | ||||
-rw-r--r-- | examples/network/git2.c | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/examples/general.c b/examples/general.c index 9bfbc4083..8b58fa6ff 100644 --- a/examples/general.c +++ b/examples/general.c @@ -430,14 +430,14 @@ int main (int argc, char** argv) printf("\n*Config Listing*\n"); const char *email; - int j; + int32_t j; git_config *cfg; // Open a config object so we can read global values from it. git_config_open_ondisk(&cfg, "~/.gitconfig"); - git_config_get_int(cfg, "help.autocorrect", &j); + git_config_get_int32(cfg, "help.autocorrect", &j); printf("Autocorrect: %d\n", j); git_config_get_string(cfg, "user.email", &email); diff --git a/examples/network/.gitignore b/examples/network/.gitignore new file mode 100644 index 000000000..1b48e66ed --- /dev/null +++ b/examples/network/.gitignore @@ -0,0 +1 @@ +/git2 diff --git a/examples/network/git2.c b/examples/network/git2.c index 0468c8ace..def56e83b 100644 --- a/examples/network/git2.c +++ b/examples/network/git2.c @@ -44,7 +44,8 @@ int main(int argc, char **argv) int i, error; if (argc < 2) { - fprintf(stderr, "usage: %s <cmd> [repo]", argv[0]); + fprintf(stderr, "usage: %s <cmd> [repo]\n", argv[0]); + exit(EXIT_FAILURE); } for (i = 0; commands[i].name != NULL; ++i) { @@ -53,5 +54,5 @@ int main(int argc, char **argv) } fprintf(stderr, "Command not found: %s\n", argv[1]); - + return 1; } |