summaryrefslogtreecommitdiff
path: root/tests/t15-config.c
Commit message (Collapse)AuthorAgeFilesLines
* repository: Change ownership semanticsVicent Marti2011-11-261-358/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ownership semantics have been changed all over the library to be consistent. There are no more "borrowed" or duplicated references. Main changes: - `git_repository_open2` and `3` have been dropped. - Added setters and getters to hotswap all the repository owned objects: `git_repository_index` `git_repository_set_index` `git_repository_odb` `git_repository_set_odb` `git_repository_config` `git_repository_set_config` `git_repository_workdir` `git_repository_set_workdir` Now working directories/index files/ODBs and so on can be hot-swapped after creating a repository and between operations. - All these objects now have proper ownership semantics with refcounting: they all require freeing after they are no longer needed (the repository always keeps its internal reference). - Repository open and initialization has been updated to keep in mind the configuration files. Bare repositories are now always detected, and a default config file is created on init. - All the tests affected by these changes have been dropped from the old test suite and ported to the new one.
* filebuf: add GIT_FILEBUF_INIT and protect multiple opens and cleanupsRussell Belfer2011-11-221-1/+1
| | | | | | | | 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>
* *: correct and codify various file permissionsBrodie Rao2011-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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".
* config: behave like git with [section.subsection]Carlos Martín Nieto2011-10-011-4/+17
| | | | | | | | 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>
* config: Proper type declarations for 64 bit intsVicent Marti2011-09-301-32/+32
|
* Make repo config loading automatic or completely explicitCarlos Martín Nieto2011-09-271-16/+3
| | | | | | | | | | | 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>
* Revert "Rewrite getenv to use Win32 version on Windows"Vicent Marti2011-09-271-2/+2
| | | | This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
* config: make git_config_[get|set]_long() able to properly deal with 8 bytes ↵nulltoken2011-09-221-1/+19
| | | | | | | | wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
* Rewrite getenv to use Win32 version on WindowsPaul Betts2011-09-211-2/+2
|
* Fix tests to use portable setenvPaul Betts2011-09-191-4/+5
|
* git_repository_config: open global config file automaticallyCarlos Martín Nieto2011-09-121-2/+16
| | | | | | If the global configuration file is missing, it is ignored. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Drop STRLEN() macrosKirill A. Shutemov2011-08-251-1/+1
| | | | | | | 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>
* config: Rename `del` to `deleteVicent Marti2011-07-121-4/+4
|
* Restore config10 test fileCarlos Martín Nieto2011-07-051-0/+7
| | | | | | | | 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>
* Add variable writing testsCarlos Martín Nieto2011-07-051-0/+28
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add test for section header at end of fileCarlos Martín Nieto2011-07-051-0/+9
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add tests for deleting a config varCarlos Martín Nieto2011-07-051-0/+30
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Fix sorting of repository config filesVicent Marti2011-06-181-2/+1
|
* config: Fix compilation in MSVCVicent Marti2011-06-181-8/+1
|
* config: Cleanup external APIVicent Marti2011-06-181-21/+14
| | | | | Do not mess with environment variables anymore. The new external API has more helper methods, and everything is explicit.
* Add fall-back support to the configurationCarlos Martín Nieto2011-06-171-0/+21
| | | | | | | 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>
* Add a test for overriding configCarlos Martín Nieto2011-06-171-0/+21
| | | | | | The repo's configuration should take precedence over the global one. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Test replacing a valueCarlos Martín Nieto2011-06-141-0/+22
| | | | | | Add a test to check that value replacement works. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add test for empty config fileCarlos Martín Nieto2011-05-311-0/+9
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add test for invalid ext headerCarlos Martín Nieto2011-05-311-0/+8
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add config test for empty lineCarlos Martín Nieto2011-05-311-0/+15
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Cleanup & renaming of the external APIVicent Marti2011-05-201-6/+6
| | | | | | | | "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.
* t15: Remove unused variableVicent Marti2011-05-171-1/+0
|
* Move config to a backend structureCarlos Martín Nieto2011-05-101-6/+6
| | | | | | | | | | | | 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>
* config: allow uppercase number suffixesCarlos Martín Nieto2011-04-191-0/+9
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: add tests for number suffixCarlos Martín Nieto2011-04-111-0/+24
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Merge upstream/developmentCarlos Martín Nieto2011-04-111-0/+138