tests/t15-config.c


Log

Author Commit Date CI Message
Russell Belfer b762e576 2011-11-17T15:10:27 filebuf: add GIT_FILEBUF_INIT and protect multiple opens and cleanups Update all stack allocations of git_filebuf to use GIT_FILEBUF_INIT and make git_filebuf_open and git_filebuf_cleanup safe to be called multiple times on the same buffer. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Brodie Rao 01ad7b3a 2011-09-06T15:48:45 *: correct and codify various file permissions The following files now have 0444 permissions: - loose objects - pack indexes - pack files - packs downloaded by fetch - packs downloaded by the HTTP transport And the following files now have 0666 permissions: - config files - repository indexes - reflogs - refs This brings libgit2 more in line with Git. Note that git_filebuf_commit() and git_filebuf_commit_at() have both gained a new mode parameter. The latter change fixes an important issue where filebufs created with GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3) usage). Now we chmod() the file before renaming it into place. Tests have been added to confirm that new commit, tag, and tree objects are created with the right permissions. I don't have access to Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
Carlos Martín Nieto 9ac581bf 2011-10-01T19:56:04 config: behave like git with [section.subsection] The documentation is a bit misleading. The subsection name is always case-sensitive, but with a [section.subsection] header, the subsection is transformed to lowercase when the configuration is parsed. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Vicent Marti fafd4710 2011-09-30T16:08:06 config: Proper type declarations for 64 bit ints
Carlos Martín Nieto 40fe5fbe 2011-09-22T22:50:36 Make repo config loading automatic or completely explicit git_repository_config wants to take the global and system paths again so that one can be explicit if needed. The git_repository_config_autoload function is provided for the cases when it's good enough for the library to guess where those files are located. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Vicent Marti 01d7fded 2011-09-22T20:44:30 Revert "Rewrite getenv to use Win32 version on Windows" This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
nulltoken ad196c6a 2011-09-21T23:17:39 config: make git_config_[get|set]_long() able to properly deal with 8 bytes wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Paul Betts e1b86444 2011-09-21T11:17:30 Rewrite getenv to use Win32 version on Windows
Paul Betts c498701d 2011-09-19T10:38:44 Fix tests to use portable setenv
Carlos Martín Nieto f9d4b0c3 2011-09-12T17:25:46 git_repository_config: open global config file automatically If the global configuration file is missing, it is ignored. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Kirill A. Shutemov 932669b8 2011-08-25T14:22:57 Drop STRLEN() macros There is no need in STRLEN macros. Compilers can do this trivial optimization on its own. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Vicent Marti b08683ff 2011-07-12T02:38:20 config: Rename `del` to `delete
Carlos Martín Nieto 7a7ef2dc 2011-07-05T17:44:51 Restore config10 test file Removing a section variable doesn't remove its section header. Overwrite the config10 file so there are no changes after the test is run. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 7d69f788 2011-06-28T16:48:04 Add variable writing tests Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 156af801 2011-06-28T16:27:16 Add test for section header at end of file Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 2601fcfc 2011-06-28T15:21:44 Add tests for deleting a config var Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti 2a406ab5 2011-06-18T02:08:56 config: Fix sorting of repository config files
Vicent Marti dbe70bd5 2011-06-18T01:12:58 config: Fix compilation in MSVC
Vicent Marti 07ff8817 2011-06-18T00:39:39 config: Cleanup external API Do not mess with environment variables anymore. The new external API has more helper methods, and everything is explicit.
Carlos Martín Nieto f3dad3ac 2011-06-16T20:06:36 Add fall-back support to the configuration If a config has several files, we need to check all of them before we can say that a variable doesn't exist. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 3de5df7d 2011-06-16T19:56:48 Add a test for overriding config The repo's configuration should take precedence over the global one. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto a98b0d80 2011-06-14T14:26:08 Test replacing a value Add a test to check that value replacement works. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto fc0ee5bd 2011-05-31T17:54:50 Add test for empty config file Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 30d0550d 2011-05-31T16:31:19 Add test for invalid ext header Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 38d0bc1e 2011-05-31T16:06:01 Add config test for empty line Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti b0b527e0 2011-05-20T03:20:12 config: Cleanup & renaming of the external API "git_config_backend" have been renamed to "git_config_file", which implements a generic interface to access a configuration file -- be it either on disk, from a DB or whatever mumbojumbo. I think this makes more sense.
Vicent Marti c9662061 2011-05-17T15:12:25 t15: Remove unused variable
Carlos Martín Nieto c0335005 2011-05-06T12:42:47 Move config to a backend structure Configuration options can come from different sources. Currently, there is only support for reading them from a flat file, but it might make sense to read it from a database at some point. Move the parsing code into src/config_file.c and create an include file include/git2/config_backend.h to allow for other backends to be developed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto a99264bf 2011-04-19T16:34:22 config: allow uppercase number suffixes Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 53345e1f 2011-04-11T18:01:01 config: add tests for number suffix Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 55c197cd 2011-04-11T17:41:21 Merge upstream/development