summaryrefslogtreecommitdiff
path: root/tests-clar/config/multivar.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-141-288/+0
|
* Fix saving remotes with several fetch/push ref specs.Daniel Rodríguez Troitiño2013-11-011-0/+65
| | | | | | | | | | | | | | | | | | | | | | At some moment git_config_delete_entry lost the ability to delete one entry of a multivar configuration. The moment you had more than one fetch or push ref spec for a remote you will not be able to save that remote anymore. The changes in network::remote::remotes::save show that problem. I needed to create a new git_config_delete_multivar because I was not able to remove one or several entries of a multivar config with the current API. Several tries modifying how git_config_set_multivar(..., NULL) behaved were not successful. git_config_delete_multivar is very similar to git_config_set_multivar, and delegates into config_delete_multivar of config_file. This function search for the cvar_t that will be deleted, storing them in a temporal array, and rebuilding the linked list. After calling config_write to delete the entries, the cvar_t stored in the temporal array are freed. There is a little fix in config_write, it avoids an infinite loop when using a regular expression (case for the multivars). This error was found by the test network::remote::remotes::tagopt.
* config: don't special-case the multivar iteratorCarlos Martín Nieto2013-08-141-1/+1
| | | | | Build it on top of the normal iterator instead, which lets use re-use a lot of code.
* config: add _next() and _iterator_free()Carlos Martín Nieto2013-08-081-0/+18
| | | | Make it look like the refs iterator API.
* config: working multivar iteratorCarlos Martín Nieto2013-08-081-7/+7
| | | | Implement the foreach version as a wrapper around the iterator.
* config: get_multivar -> get_multivar_foreachCarlos Martín Nieto2013-08-081-22/+22
| | | | | The plain function will return an iterator, so move this one out of the way.
* Add more tests for git_config_get_multivarRussell Belfer2013-07-091-8/+48
| | | | | | The old tests didn't try failing lookups or lookups across multiple config files with some having the pattern and some not having it.
* config: allow setting multivars when none exist yetCarlos Martín Nieto2013-04-201-0/+16
| | | | | Adding a multivar when there are no variables with that name set should set the variable instead of failing.
* Add config level support in the config APIyorah2012-10-231-6/+4
| | | | | | | 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
* errors: Rename the generic return codesVicent Martí2012-05-181-2/+2
|
* Discovered cl_git_strequal! Mounted a crusade!Ben Straub2012-03-311-1/+1
|
* Fixing memory leaks indicated by valgrindRussell Belfer2012-03-021-0/+3
| | | | | This clears up the memory leaks that valgrind seems to find on my machine.
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-2/+6
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* config: add more comprehensive multivar testsCarlos Martín Nieto2012-02-251-13/+69
|
* Implement setting multivarsCarlos Martín Nieto2012-02-171-2/+38
|
* Support getting multivarsCarlos Martín Nieto2012-02-171-0/+28
|
* tests: add multivar read testCarlos Martín Nieto2012-02-171-0/+24