diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-12-21 15:31:03 +0000 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-03-03 18:35:12 +0100 |
commit | 9a97f49e3aa15edc479fc590f4b28fc44c155c40 (patch) | |
tree | b85de2d396b9d0d408f688212c0cdc74347ea7b3 /CHANGELOG.md | |
parent | 76f034180aee96fcc1fffd5267ccbc6ada68482a (diff) | |
download | libgit2-9a97f49e3aa15edc479fc590f4b28fc44c155c40.tar.gz |
config: borrow refcounted referencescmn/config-borrow-entry
This changes the get_entry() method to return a refcounted version of
the config entry, which you have to free when you're done.
This allows us to avoid freeing the memory in which the entry is stored
on a refresh, which may happen at any time for a live config.
For this reason, get_string() has been forbidden on live configs and a
new function get_string_buf() has been added, which stores the string in
a git_buf which the user then owns.
The functions which parse the string value takea advantage of the
borrowing to parse safely and then release the entry.
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r-- | CHANGELOG.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b88488e61..6f9e1f1cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ v0.22 + 1 set and query which identity will be used when writing to the reflog. +* `git_config_entry_free()` frees a config entry. + +* `git_config_get_string_buf()` provides a way to safely retrieve a + string from a non-snapshot configuration. + ### API removals ### Breaking API changes @@ -53,6 +58,13 @@ v0.22 + 1 `git_repository_detach_head()` * `git_reset()` +* `git_config_get_entry()` now gives back a ref-counted + `git_config_entry`. You must free it when you no longer need it. + +* `git_config_get_string()` will return an error if used on a + non-snapshot configuration, as there can be no guarantee that the + returned pointer is valid. + v0.22 ------ |