Commit e459253815086d6563d359f480d867557598dabf

Clemens Buchacher 2011-12-29T13:12:51

allow opening index in bare repo The git.git implementation allows this, and there is no reason not to.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/repository.c b/src/repository.c
index 67afa2e..f87e4d8 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -348,9 +348,6 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
 {
 	assert(out && repo);
 
-	if (repo->is_bare)
-		return git__throw(GIT_EBAREINDEX, "Cannot open index in bare repository");
-
 	if (repo->_index == NULL) {
 		int error;
 		git_buf index_path = GIT_BUF_INIT;