mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-21 20:34:17 +00:00
Merge pull request #473 from drafnel/bc/update-examples
bc/update examples
This commit is contained in:
commit
38068dc1d3
@ -430,14 +430,14 @@ int main (int argc, char** argv)
|
|||||||
printf("\n*Config Listing*\n");
|
printf("\n*Config Listing*\n");
|
||||||
|
|
||||||
const char *email;
|
const char *email;
|
||||||
int j;
|
int32_t j;
|
||||||
|
|
||||||
git_config *cfg;
|
git_config *cfg;
|
||||||
|
|
||||||
// Open a config object so we can read global values from it.
|
// Open a config object so we can read global values from it.
|
||||||
git_config_open_ondisk(&cfg, "~/.gitconfig");
|
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);
|
printf("Autocorrect: %d\n", j);
|
||||||
|
|
||||||
git_config_get_string(cfg, "user.email", &email);
|
git_config_get_string(cfg, "user.email", &email);
|
||||||
|
1
examples/network/.gitignore
vendored
Normal file
1
examples/network/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/git2
|
@ -119,7 +119,7 @@ int fetch(git_repository *repo, int argc, char **argv)
|
|||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
git__free(packname);
|
free(packname);
|
||||||
git_indexer_free(idx);
|
git_indexer_free(idx);
|
||||||
git_remote_free(remote);
|
git_remote_free(remote);
|
||||||
|
|
||||||
|
@ -44,7 +44,8 @@ int main(int argc, char **argv)
|
|||||||
int i, error;
|
int i, error;
|
||||||
|
|
||||||
if (argc < 2) {
|
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) {
|
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]);
|
fprintf(stderr, "Command not found: %s\n", argv[1]);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user