summaryrefslogtreecommitdiff
path: root/src/merge.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-06-04 17:31:42 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-06-04 17:31:42 +0200
commit57cb1179e5c9c8f5c27c9115f13f1cae5d0f87a0 (patch)
tree67871086b1437dcd410979b423cd3ba140ab9257 /src/merge.c
parent90befde4a1938641dfdb9a7bdb9f361d1de5c26f (diff)
downloadlibgit2-cmn/config-default-snapshot.tar.gz
Make the default repository config getter return a snapshotcmn/config-default-snapshot
You should always use a snapshot, with the sole exception of writing to the configuration. Any reads that are not against a snapshot have race conditions, both in terms of returned values as well as dangling pointers.
Diffstat (limited to 'src/merge.c')
-rw-r--r--src/merge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/merge.c b/src/merge.c
index a279d31d4..beb6c8f9c 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2572,7 +2572,7 @@ static int merge_preference(git_merge_preference_t *out, git_repository *repo)
*out = GIT_MERGE_PREFERENCE_NONE;
- if ((error = git_repository_config_snapshot(&config, repo)) < 0)
+ if ((error = git_repository_config(&config, repo)) < 0)
goto done;
if ((error = git_config_get_string(&value, config, "merge.ff")) < 0) {