summaryrefslogtreecommitdiff
path: root/examples/add.c
diff options
context:
space:
mode:
authorPeter Salomonsen <pjsalomonsen@gmail.com>2020-02-24 18:30:16 +0100
committerPeter Salomonsen <pjsalomonsen@gmail.com>2020-04-02 18:39:37 +0200
commitdc2beb7e2db7bea94a5bd5f8c6e10467f94ff3cc (patch)
tree775c7b78e1268a1b5b40e06bd773870edc90d0f9 /examples/add.c
parent705f4e85ba91366836a437a98a1bbf1695b779d0 (diff)
downloadlibgit2-dc2beb7e2db7bea94a5bd5f8c6e10467f94ff3cc.tar.gz
examples: additions and fixes
add example for git commit fix example for git add add example for git push
Diffstat (limited to 'examples/add.c')
-rw-r--r--examples/add.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/add.c b/examples/add.c
index 6e3c239fc..542360ea9 100644
--- a/examples/add.c
+++ b/examples/add.c
@@ -48,9 +48,11 @@ int lg2_add(git_repository *repo, int argc, char **argv)
git_index_matched_path_cb matched_cb = NULL;
git_index *index;
git_strarray array = {0};
- struct index_options options;
+ struct index_options options = {0};
struct args_info args = ARGS_INFO_INIT;
+ options.mode = INDEX_ADD;
+
/* Parse the options & arguments. */
parse_opts(NULL, &options, &args);
strarray_from_args(&array, &args);