tests/resources/config


Log

Author Commit Date CI Message
Patrick Steinhardt b7dcea04 2019-09-26T15:06:12 config_entries: micro-optimize storage of multivars Multivars are configuration entries that have many values for the same name; we can thus micro-optimize this case by just retaining the name of the first configuration entry and freeing all the others, letting them point to the string of the first entry. The attached test case is an extreme example that demonstrates this. It contains a section name that is approximately 500kB in size with 20.000 entries "a=b". Without the optimization, this would require at least 20000*500kB bytes, which is around 10GB. With this patch, it only requires 500kB+20000*1B=20500kB. The obvious culprit here is the section header, which we repeatedly include in each of the configuration entry's names. This makes it very easier for an adversary to provide a small configuration file that disproportionally blows up in memory during processing and is thus a feasible way for a denial-of-service attack. Unfortunately, we cannot fix the root cause by e.g. having a separate "section" field that may easily be deduplicated due to the `git_config_entry` structure being part of our public API. So this micro-optimization is the best we can do for now.
Nelson Elhage f1409500 2018-08-14T03:54:01 Write a test.
Ryan Roden-Corrent f56a417d 2015-04-16T15:20:33 Specify mock config file content in test. Instead of using a config file in resources, include the config file content to be tested directly in the test.
Ryan Roden-Corrent a060cccc 2015-04-16T10:53:22 Unittest to validate config entry deletion bug. 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.
Linquize a447a7e4 2014-10-04T23:28:40 config: Add test cases that have trailing spaces before comment chars
Ben Straub 17820381 2013-11-14T14:05:52 Rename tests-clar to tests
Vicent Martí a1d08025 2012-05-02T16:33:26 Backport more test data
Vicent Martí 40879fac 2012-05-02T15:59:02 Merge branch 'new-error-handling' into development Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
Carlos Martín Nieto 19dd4e28 2012-04-25T20:42:33 Include the new config test file
Carlos Martín Nieto 2c1075d6 2012-03-16T12:52:49 config: parse quoted values Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
Ben Straub fd29cd13 2012-03-31T16:10:01 Moved testing resources to clar, and removed old tests directory. Removed the BUILD_CLAR CMake flag, and updated the readme.
Carlos Martín Nieto 3005855f 2012-02-05T00:29:26 Implement setting multivars
Carlos Martín Nieto 78d65f39 2012-02-01T17:47:17 tests: add multivar read test
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>
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>
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>
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>
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 8cd767ef 2011-04-04T17:07:47 config: test for a variable on its own If a variable is on its own, truth should be assumed. Check this is true in our code. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 0bf8ca88 2011-04-04T16:44:23 config: add tests These tests are basic, but they should tell us when we've broken something. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>