From 57cb1179e5c9c8f5c27c9115f13f1cae5d0f87a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 4 Jun 2014 17:31:42 +0200 Subject: Make the default repository config getter return a 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. --- src/diff_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/diff_driver.c') diff --git a/src/diff_driver.c b/src/diff_driver.c index c3c5f365b..56f89b30c 100644 --- a/src/diff_driver.c +++ b/src/diff_driver.c @@ -239,7 +239,7 @@ static int git_diff_driver_load( memcpy(drv->name, driver_name, namelen); /* if you can't read config for repo, just use default driver */ - if (git_repository_config_snapshot(&cfg, repo) < 0) { + if (git_repository_config(&cfg, repo) < 0) { giterr_clear(); goto done; } -- cgit v1.2.1