From 54ccc71786cf5a0fee69e7ec173e62abd4a12af5 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sat, 5 Nov 2011 18:01:32 -0500 Subject: [PATCH 1/5] examples/general.c: update for recent API renaming of git_config_get_int git_config_get_int --> git_config_get_int32 --- examples/general.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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); From faeebd06e41f2711ad4b3c99f3f10e5778c8a5cd Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sun, 6 Nov 2011 19:35:35 -0600 Subject: [PATCH 2/5] examples/network/fetch.c: revert overzealous conversion of free to git__free Since git__free is not exported (it's actually a macro), it should not be used in client programs. Change this call to 'git__free' back to 'free'. --- examples/network/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/network/fetch.c b/examples/network/fetch.c index 35fc3eae4..dd732f22e 100644 --- a/examples/network/fetch.c +++ b/examples/network/fetch.c @@ -119,7 +119,7 @@ int fetch(git_repository *repo, int argc, char **argv) if (error < GIT_SUCCESS) return error; - git__free(packname); + free(packname); git_indexer_free(idx); git_remote_free(remote); From 983562e47537eef4c9d7706d036245a1896dd5f2 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sun, 6 Nov 2011 19:43:44 -0600 Subject: [PATCH 3/5] examples/network/git2.c: add newline to usage message --- examples/network/git2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/network/git2.c b/examples/network/git2.c index 0468c8ace..a4bff4a2a 100644 --- a/examples/network/git2.c +++ b/examples/network/git2.c @@ -44,7 +44,7 @@ int main(int argc, char **argv) int i, error; if (argc < 2) { - fprintf(stderr, "usage: %s [repo]", argv[0]); + fprintf(stderr, "usage: %s [repo]\n", argv[0]); } for (i = 0; commands[i].name != NULL; ++i) { From 349532d0b1fd4eb94b398616602674ff516f6d76 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sun, 6 Nov 2011 19:44:29 -0600 Subject: [PATCH 4/5] examples/network/git2.c: exit with proper status, and avoid segfault This function should exit after printing usage information if too few arguments were specified. Additionally, it should exit with a failure status if the first argument supplied is not one in the internal command list. --- examples/network/git2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/network/git2.c b/examples/network/git2.c index a4bff4a2a..def56e83b 100644 --- a/examples/network/git2.c +++ b/examples/network/git2.c @@ -45,6 +45,7 @@ int main(int argc, char **argv) if (argc < 2) { fprintf(stderr, "usage: %s [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; } From 0b142c9cb207444e22c4136c64c4d7bcecb2ccef Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sun, 6 Nov 2011 20:07:27 -0600 Subject: [PATCH 5/5] examples/network/.gitignore: ignore 'git2' --- examples/network/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/network/.gitignore 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