summaryrefslogtreecommitdiff
path: root/src/notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/notes.c')
-rw-r--r--src/notes.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/notes.c b/src/notes.c
index beace1b50..d8ed32f82 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -378,20 +378,11 @@ cleanup:
static int note_get_default_ref(const char **out, git_repository *repo)
{
- int ret;
git_config *cfg;
+ int ret = git_repository_config__weakptr(&cfg, repo);
- *out = NULL;
-
- if (git_repository_config__weakptr(&cfg, repo) < 0)
- return -1;
-
- ret = git_config_get_string(out, cfg, "core.notesRef");
- if (ret == GIT_ENOTFOUND) {
- giterr_clear();
- *out = GIT_NOTES_DEFAULT_REF;
- return 0;
- }
+ *out = (ret != 0) ? NULL : git_config__get_string_force(
+ cfg, "core.notesref", GIT_NOTES_DEFAULT_REF);
return ret;
}