summaryrefslogtreecommitdiff
path: root/src/config_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* config_cache: check return value of `git_config__lookup_entry`Patrick Steinhardt2016-03-111-1/+2
| | | | | | | | | | | | | | Callers of `git_config__cvar` already handle the case where the function returns an error due to a failed configuration variable lookup, but we are actually swallowing errors when calling `git_config__lookup_entry` inside of the function. Fix this by returning early when `git_config__lookup_entry` returns an error. As we call `git_config__lookup_entry` with `no_errors == false` which leads us to call `get_entry` with `GET_NO_MISSING` we will not return early when the lookup fails due to a missing entry. Like this we are still able to set the default value of the cvar and exit successfully.
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-1/+2
| | | | | | | | | | | | | | | 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.
* Introduce core.protectHFS and core.protectNTFSEdward Thomson2014-12-171-0/+2
| | | | | | Validate HFS ignored char ".git" paths when `core.protectHFS` is specified. Validate NTFS invalid ".git" paths when `core.protectNTFS` is specified.
* Ignore core.safecrlf=warn until we have a warn infrastructureEdward Thomson2014-05-301-1/+7
|
* Increase use of config snapshotsrb/coverity-fixesRussell Belfer2014-05-131-18/+24
| | | | And decrease extra reload checks of config data.
* Introduce core.safecrlf handlingEdward Thomson2014-04-071-0/+1
|
* Add config read fns with controlled error behaviorRussell Belfer2013-12-111-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | This adds `git_config__lookup_entry` which will look up a key in a config and return either the entry or NULL if the key was not present. Optionally, it can either suppress all errors or can return them (although not finding the key is not an error for this function). Unlike other accessors, this does not normalize the config key string, so it must only be used when the key is known to be in normalized form (i.e. all lower-case before the first dot and after the last dot, with no invalid characters). This also adds three high-level helper functions to look up config values with no errors and a fallback value. The three functions are for string, bool, and int values, and will resort to the fallback value for any error that arises. They are: * `git_config__get_string_force` * `git_config__get_bool_force` * `git_config__get_int_force` None of them normalize the config `key` either, so they can only be used for internal cases where the key is known to be in normal format.
* Put hooks in place for precompose in dirload fnRussell Belfer2013-10-031-0/+1
| | | | | | This doesn't actual do string precompose but it puts the hooks in place into the iterators and the git_path_dirload function so that the actual precompose work is ready to go.
* Add configs to repo config cacheRussell Belfer2013-04-231-7/+24
| | | | | | | | | | | | | This adds a bunch of additional config values to the repository config value cache and makes it easier to add a simple boolean config without creating enum values for each possible setting. Also, this fixes a bug in git_config_refresh where the config cache was not being cleared which could lead to potential incorrect values. The work to start using the new cached configs will come in the next couple of commits...
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Vade retro satanaVicent Marti2012-12-031-1/+1
|
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-1/+1
|
* errors: Rename the generic return codesVicent Martí2012-05-181-4/+4
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-2/+2
| | | | Consistency is good.
* Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-251-1/+0
| | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
* config: Add missing fileVicent Martí2012-03-021-0/+95