Commit 0c52b204c5a792cb9515e93fdea35811ae09807b

Russell Belfer 2013-09-09T11:07:17

Make work if built with threading enabled

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/examples/add.c b/examples/add.c
index cab57dc..a0edf43 100644
--- a/examples/add.c
+++ b/examples/add.c
@@ -106,6 +106,8 @@ int main (int argc, char** argv)
 		return 1;
 	}
 
+	git_threads_init();
+
 	init_array(&array, argc-i, argv+i);
 
 	if (git_repository_open(&repo, ".") < 0) {
@@ -135,5 +137,7 @@ int main (int argc, char** argv)
 	git_index_free(index);
 	git_repository_free(repo);
 
+	git_threads_shutdown();
+
 	return 0;
 }