summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-06-21 02:15:25 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-06-21 02:15:25 +0200
commitb3aa440641135619ff3890da03c65ba52396f42c (patch)
treea89e7d272c4d704aaf428a7f50175a0c5c570378
parent9fae82405dd7db7b3c53c4a77ee78e83eca67a2b (diff)
downloadlibgit2-b3aa440641135619ff3890da03c65ba52396f42c.tar.gz
repository: avoid opening the repository twice on reinit
The call to repo_init_reinit already takes care of opening the repository and giving us a git_repository object to give to the caller. There is no need to call git_repository_open again.
-rw-r--r--src/repository.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/repository.c b/src/repository.c
index 4806215e8..23a95b23e 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -854,6 +854,7 @@ int git_repository_init(git_repository **repo_out, const char *path, unsigned is
goto cleanup;
result = repo_init_config(repository_path.ptr, is_bare, is_reinit);
+ goto cleanup;
}
if (repo_init_structure(repository_path.ptr, is_bare) < 0 ||