Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-10-01Add negative test cases for config header with invalid charactersLinquize
2013-10-01Add test case to test ']' and '\\' characters in config subsectionLinquize
2013-09-25Make tests pass if XDG config existsRussell Belfer
2013-09-07config: handle realloc issues from larger depthsCarlos Martín Nieto
As the include depth increases, the chance of a realloc increases. This means that whenever we run git_array_alloc() or call config_parse(), we need to remember what our reader's index is so we can look it up again.
2013-09-07config: fix variable overridingCarlos Martín Nieto
When two or more variables of the same name exist and the user asks for a scalar, we must return the latest value assign to it.
2013-09-07config: refresh included filesCarlos Martín Nieto
We need to refresh the variables from the included files if they are changed, so loop over all included files and re-parse the files if any of them has changed.
2013-09-07config: add support for include directivesCarlos Martín Nieto
Relative, absolute and home-relative paths are supported. The recursion limit it set at 10, just like in git.
2013-08-28Merge pull request #1772 from libgit2/config-iterVicent Martí
Configuration iterators redux
2013-08-14config: don't special-case the multivar iteratorCarlos Martín Nieto
Build it on top of the normal iterator instead, which lets use re-use a lot of code.
2013-08-12config: introduce a regex-filtering iteratorCarlos Martín Nieto
2013-08-12config: introduce _iterator_new()Carlos Martín Nieto
As the name suggests, it iterates over all the entries
2013-08-08Merge pull request #1771 from nvloff/write_empty_config_valueRussell Belfer
config: allow setting empty string as value
2013-08-08config: allow empty string as valueNikolai Vladimirov
`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>
2013-08-08config: add _next() and _iterator_free()Carlos Martín Nieto
Make it look like the refs iterator API.
2013-08-08config: working multivar iteratorCarlos Martín Nieto
Implement the foreach version as a wrapper around the iterator.
2013-08-08config: get_multivar -> get_multivar_foreachCarlos Martín Nieto
The plain function will return an iterator, so move this one out of the way.
2013-08-07Parse config headers with quoted quotesEdward Thomson
Parse config headers that have the last quote on the line quoted instead of walking off the end.
2013-07-10Add more tests for git_config_get_multivarRussell Belfer
The old tests didn't try failing lookups or lookups across multiple config files with some having the pattern and some not having it.
2013-05-07config: convenience function to open global/xdgCarlos Martín Nieto
The rules for which one to open is a bit silly, so let's make it easier for our users.
2013-05-07repo: unconditionally create a global config backendCarlos Martín Nieto
When a repository is initialised, we need to probe to see if there is a global config to load. If this is not the case, the user isn't able to write to the global config without creating the backend and adding it themselves, which is inconvenient and overly complex. Unconditionally create and add a backend for the global config file regardless of whether it exists as a convenience for users. To enable this, we allow creating backends to files that do not exist yet, changing the semantics somewhat, and making some tests invalid.
2013-04-22Merge pull request #1493 from carlosmn/remotesVicent Martí
Revamp the refspec handling
2013-04-21Move git_config_backend to include/git2/sysRussell Belfer
Moving backend implementor objects into include/git2/sys so the APIs can be isolated from the ones that normal libgit2 users would be likely to use.
2013-04-20config: allow setting multivars when none exist yetCarlos Martín Nieto
Adding a multivar when there are no variables with that name set should set the variable instead of failing.
2013-03-09config: don't allow passing NULL as a value to setCarlos Martín Nieto
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.
2013-01-30Test config name validationRussell Belfer
This is @nulltoken's work to test various invalid config section and key names and make sure we are validating properly.
2013-01-26Merge pull request #1278 from sba1/cl-assert-equal-sVicent Martí
Use cl_assert_equal_s() instead of strcmp().
2013-01-25config: support trailing backslashesCarlos Martín Nieto
Check whether the backslash at the end of the line is being escaped or not so as not to consider it a continuation marker when it's e.g. a Windows-style path.
2013-01-25Use cl_assert_equal_s() instead of strcmp().Sebastian Bauer
Replaced all cl_assert(!strcmp()) or semantically equivalent forms by cl_assert_equal_s().
2013-01-06tests: Fix some memory leaksnulltoken
2013-01-03Proper cleanup jeezVicent Marti
2013-01-03Move test cleanup into cleanup functionsBen Straub
2013-01-03Cleanup after testsBen Straub
2012-12-05versions: MSVC build fixesVicent Marti
2012-12-01Deploy git_config_backend versionBen Straub
2012-11-28Clean up config.hBen Straub
2012-11-18Fix a couple of warningsMichael Schubert
2012-11-18config: Opening a nonexistent file returns ENOTFOUNDnulltoken
2012-11-14config: return an emtpy string when there is no valueCarlos Martín Nieto
Returning NULL for the string when we haven't signaled an error condition is counter-intuitive and causes unnecessary edge cases. Return an empty string when asking for a string value for a configuration variable such as '[section] var' to avoid these edge cases. If the distinction between no value and an empty value is needed, this can be retrieved from the entry directly. As a side-effect, this change stops the int parsing functions from segfaulting on such a variable.
2012-11-14config: distinguish between a lone variable name and one without rhsCarlos Martín Nieto
'[section] variable' and '[section] variable =' behave differently when parsed as booleans, so we need to store that distinction internally.
2012-11-14config: rename get_config_entry -> config_entryCarlos Martín Nieto
We're already in the git_config namespace, there is no need to repeat it.
2012-11-13Remove unused variablesMichael Schubert
2012-11-10config: make git_config_open_level() work with an empty confignulltoken
2012-10-30Add git_config_refresh() API to reload configRussell Belfer
This adds a new API that allows users to reload the config if the file has changed on disk. A new config callback function to refresh the config was added. The modified time and file size are used to test if the file needs to be reloaded (and are now stored in the disk backend object). In writing tests, just using mtime was a problem / race, so I wanted to check file size as well. To support that, I extended `git_futils_readbuffer_updated` to optionally check file size in addition to mtime, and I added a new function `git_filebuf_stats` to fetch the mtime and size for an open filebuf (so that the config could be easily refreshed after a write). Lastly, I moved some similar file checking code for attributes into filebuf. It is still only being used for attrs, but it seems potentially reusable, so I thought I'd move it over.
2012-10-25remote: introduce git_remote_rename()nulltoken
2012-10-25branch: remove config section upon deletionnulltoken
2012-10-23Add config level support in the config APIyorah
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
2012-10-23Fix adding variable to config file with no trailing newlineyorah
This can occur after a manual modification of a config file.
2012-08-12Fix config parser boundary logicRussell Belfer
The config file parser was not working right if there was no whitespace between the value name and the equals sign. This fixes that.
2012-08-04Update iterators for consistency across libraryRussell Belfer
This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
2012-07-21tests: plug a leak in the config stressCarlos Martín Nieto