Commit fa8ca519ccc6c0821864fcdb203fac92409ee0ec

Pierre-Olivier Latour 2015-01-23T15:35:29

Allow passing a NULL index to git_repository_set_index() This is supported by the underlying set_index() implementation and setting the repository index to NULL is recommended by the git_repository_set_bare() documentation.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/repository.c b/src/repository.c
index f49a251..30f0cd0 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -776,7 +776,7 @@ int git_repository_index(git_index **out, git_repository *repo)
 
 void git_repository_set_index(git_repository *repo, git_index *index)
 {
-	assert(repo && index);
+	assert(repo);
 	set_index(repo, index);
 }