summaryrefslogtreecommitdiff
path: root/examples/diff.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-05-16 11:10:42 -0700
committerVicent Martí <vicent@github.com>2013-05-16 11:10:42 -0700
commitc2d282cfd88ffba7693113786bd2209a5d38b964 (patch)
tree86da1c83c4ebb442f860147487c488659301d8bb /examples/diff.c
parent18e37db9359bc5e109702eec7422b95fac21b106 (diff)
parent8d78400142bc001e18e0b0687290d6b446e05130 (diff)
downloadlibgit2-c2d282cfd88ffba7693113786bd2209a5d38b964.tar.gz
Merge pull request #1590 from arrbee/examples-like-git
Add cat-file to examples (with some public API improvements)
Diffstat (limited to 'examples/diff.c')
-rw-r--r--examples/diff.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/diff.c b/examples/diff.c
index 2ef405665..bb4f0ec21 100644
--- a/examples/diff.c
+++ b/examples/diff.c
@@ -117,7 +117,10 @@ int main(int argc, char *argv[])
git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_diff_list *diff;
int i, color = -1, compact = 0, cached = 0;
- char *a, *dir = ".", *treeish1 = NULL, *treeish2 = NULL;
+ char *a, *treeish1 = NULL, *treeish2 = NULL;
+ const char *dir = ".";
+
+ git_threads_init();
/* parse arguments as copied from git-diff */
@@ -162,7 +165,8 @@ int main(int argc, char *argv[])
!check_uint16_param(a, "--inter-hunk-context=",
&opts.interhunk_lines) &&
!check_str_param(a, "--src-prefix=", &opts.old_prefix) &&
- !check_str_param(a, "--dst-prefix=", &opts.new_prefix))
+ !check_str_param(a, "--dst-prefix=", &opts.new_prefix) &&
+ !check_str_param(a, "--git-dir=", &dir))
usage("Unknown arg", a);
}
@@ -216,6 +220,8 @@ int main(int argc, char *argv[])
git_tree_free(t2);
git_repository_free(repo);
+ git_threads_shutdown();
+
return 0;
}