summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe rugged tests are fragile <tanoku@gmail.com>2014-09-17 15:35:50 +0200
committerThe rugged tests are fragile <tanoku@gmail.com>2014-09-17 15:35:50 +0200
commit74240afb9c3394d35dfb3fe59dc38dbff70c0368 (patch)
tree4ec2993600fd056ac9e34ec1c7a56b3c33100583
parent4e9641174884f5d81b7c12784b49c7c830116fe1 (diff)
downloadlibgit2-vmg/walk-up-path.tar.gz
repository: Do not double-free configvmg/walk-up-path
-rw-r--r--src/repository.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/repository.c b/src/repository.c
index 39a4f02b9..51d39eb6d 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1691,20 +1691,20 @@ int git_repository_set_bare(git_repository *repo)
if (repo->is_bare)
return 0;
- if ((error = git_repository_config__weakptr(&config, repo)) < 0 ||
- (error = git_config_set_bool(config, "core.bare", false)) < 0)
- goto done;
+ if ((error = git_repository_config__weakptr(&config, repo)) < 0)
+ return error;
+
+ if ((error = git_config_set_bool(config, "core.bare", false)) < 0)
+ return error;
- error = git_config__update_entry(config, "core.worktree", NULL, true, true);
+ if ((error = git_config__update_entry(config, "core.worktree", NULL, true, true)) < 0)
+ return error;
git__free(repo->workdir);
repo->workdir = NULL;
-
repo->is_bare = 1;
-done:
- git_config_free(config);
- return error;
+ return 0;
}
int git_repository_head_tree(git_tree **tree, git_repository *repo)