Fix bug in Config LookupString #258
Loading…
Reference in New Issue
No description provided.
Delete Branch "feat-config-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A solution to
get_string called on a live config object
errors when attempting a string lookup on a config object.@carlosmn, @vmg - Not sure what the best way to contact you for discussion or questions. Am I just using the Config methods wrong? I kept running into errors when doing something along these lines:
If that's supposed to work, then adding this snapshot method on config objects fixes the problem.
The snapshotting solves a different problem. We simply should not be using
git_config_get_string()
at all, butgit_config_get_string_buf()
. The former is something you can do if you know the lifetimes of your objects, but that's not something you can really know in Go.@carlosmn thanks for the tip and explanation. I updated my approach to use
git_config_get_string_buf()
. I also added some tests for the other Lookup methods. Hopefully they might serve as documentation of example usage for future users of this library.@carlosmn any further feedback or shall I just wait until more time frees up for you?
Just to clean up the history here. This PR still contains commits to add and remove snapshotting capabilities. If all you're aiming for is to get string lookups to work, that's the only one it should have.
Sorry, got caught up for a few days. Commits cleaned up and squashed.