- 30 Oct, 2017 1 commit
-
-
While most parts of a configuration key are case-insensitive, we should still be case-preserving and write down whatever string the caller provided.
Carlos Martín Nieto committed
-
- 09 Oct, 2017 1 commit
-
-
Our current configuration logic is completely oblivious of any repository, but only cares for actual file paths. Unfortunately, we are forced to break this assumption by the introduction of conditional includes, which are evaluated in the context of a repository. Right now, only one conditional exists with "gitdir:" -- it will only include the configuration if the current repository's git directory matches the value passed to "gitdir:". To support these conditionals, we have to break our API and make the repository available when opening a configuration file. This commit extends the `open` call of configuration backends to include another repository and adjusts existing code to have it available. This includes the user-visible functions `git_config_add_file_ondisk` and `git_config_add_backend`.
Patrick Steinhardt committed
-
- 31 Mar, 2016 1 commit
-
-
Edward Thomson committed
-
- 28 Mar, 2016 2 commits
-
-
Edward Thomson committed
-
We should notice that we are in the correct section to add. This is a cosmetic bug, since replacing any of these settings does work.
Carlos Martín Nieto committed
-
- 18 Sep, 2015 1 commit
-
-
Linquize committed
-
- 13 Sep, 2015 1 commit
-
-
The config is not owned by the transaction, so please don’t free it.
Arthur Schreiber committed
-
- 12 Aug, 2015 3 commits
-
-
This makes the API for commiting or discarding changes the same as for references.
Carlos Martín Nieto committed -
This lock/unlock pair allows for the cller to lock a configuration file to avoid concurrent operations. It also allows for a transactional approach to updating a configuration file. If multiple updates must be made atomically, they can be done while the config is locked.
Carlos Martín Nieto committed -
When a configuration file is locked, any updates made to it will be done to the in-memory copy of the file. This allows for multiple updates to happen while we hold the lock, preventing races during complex config-file manipulation.
Carlos Martín Nieto committed
-
- 04 May, 2015 7 commits
-
-
If a multivar exists within two sections (of the same name) then they should both be updated in a `set_multivar`. Ensure that this is the case.
Edward Thomson committed -
Edward Thomson committed
-
Edward Thomson committed
-
Add a test that exposes a bug in config_write. It is valid to have multiple separate headers for the same config section, but config_write will exit after finding the first matching section in certain situations. This test proves that config_write will duplicate a variable that already exists instead of overwriting it if the variable is defined under a duplicate section header.
Ryan Roden-Corrent committed -
Previously we would try to be clever when writing the configuration file and try to stop parsing (and simply copy the rest of the old file) when we either found the value we were trying to write, or when we left the section that value was in, the assumption being that there was no more work to do. Regrettably, you can have another section with the same name later in the file, and we must cope with that gracefully, thus we read the whole file in order to write a new file. Now, writing a file looks even more than reading. Pull the config parsing out into its own function that can be used by both reading and writing the configuration.
Edward Thomson committed -
Edward Thomson committed
-
Edward Thomson committed
-
- 23 Apr, 2015 1 commit
-
-
Edward Thomson committed
-
- 21 Apr, 2015 2 commits
-
-
Instead of using a config file in resources, include the config file content to be tested directly in the test.
Ryan Roden-Corrent committed -
Add a unittest to validate bug #3043, where a duplicate empty config header could cause deletion of a config entry to fail silently. The bug is currently unresolved and this test will fail.
Ryan Roden-Corrent committed
-
- 03 Mar, 2015 1 commit
-
-
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.
Carlos Martín Nieto committed
-
- 23 Oct, 2014 1 commit
-
-
We have been refreshing on read and write for a while now, so git_config_refresh() is at best a no-op, and might just end up wasting cycles.
Carlos Martín Nieto committed
-
- 16 Jul, 2014 1 commit
-
-
Linquize committed
-
- 18 Apr, 2014 2 commits
-
-
When writing out, parse the resulting file instead of adding or replacing the value locally. This has the effect of reading external changes as well.
Carlos Martín Nieto committed -
On set, we set/add the value written to the config's internal values, but we do not refresh old values. Document this in a test in preparation for the refresh changes.
Carlos Martín Nieto committed
-
- 11 Dec, 2013 1 commit
-
-
This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
Russell Belfer committed
-
- 14 Nov, 2013 1 commit
-
-
Ben Straub committed
-
- 07 Nov, 2013 2 commits
-
-
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth committed -
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth committed
-
- 05 Nov, 2013 1 commit
-
-
nulltoken committed
-
- 08 Aug, 2013 1 commit
-
-
`git_config_set_string(config, "config.section", "")` fails when escaping the value. The buffer in `escape_value` is allocated without NULL-termination. And in case of empty string 0 is passed for buffer size in `git_buf_grow`. `git_buf_detach` returns NULL when the allocated size is 0 and that leads to an error return in `GITERR_CHECK_ALLOC` called after `escape_value` The change in `config_file.c` was suggested by Russell Belfer <rb@github.com>
Nikolai Vladimirov committed
-
- 09 Mar, 2013 1 commit
-
-
Passing NULL is non-sensical. The error message leaves to be desired, though, as it leaks internal implementation details. Catch it at the `git_config_set_string` level and set an appropriate error message.
Carlos Martín Nieto committed
-
- 25 Jan, 2013 1 commit
-
-
Replaced all cl_assert(!strcmp()) or semantically equivalent forms by cl_assert_equal_s().
Sebastian Bauer committed
-
- 27 Nov, 2012 1 commit
-
-
Ben Straub committed
-
- 23 Oct, 2012 2 commits
-
-
Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found. Added `git_config_open_level`: build a single-level focused config object from a multi-level one. We are now storing `git_config_entry`s in the khash of the config_file
yorah committed -
This can occur after a manual modification of a config file.
yorah committed
-
- 13 Jun, 2012 2 commits
-
-
Carlos Martín Nieto committed
-
Adam Roben committed
-
- 17 May, 2012 2 commits
-
-
Vicent Martí committed
-
Vicent Martí committed
-