config: read config from a repository object
[gitweb.git] / repository.c
index cf440405a81e6f39e0d2fd459fabe0e8fee5dc2e..686a964ad6e6a2c7f1d71019fcc630163899881a 100644 (file)
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "repository.h"
+#include "config.h"
 
 /* The main repository */
 static struct repository the_repo;
@@ -156,4 +157,10 @@ void repo_clear(struct repository *repo)
        repo->index_file = NULL;
        free(repo->worktree);
        repo->worktree = NULL;
+
+       if (repo->config) {
+               git_configset_clear(repo->config);
+               free(repo->config);
+               repo->config = NULL;
+       }
 }