Commit Graph

12 Commits

Author SHA1 Message Date
Carlos Martín Nieto
48bde2f1b6 config: don't allow passing NULL as a value to set
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-03-09 15:45:18 +01:00
Sebastian Bauer
a7f8065f8c Use cl_assert_equal_s() instead of strcmp().
Replaced all cl_assert(!strcmp()) or semantically equivalent forms
by cl_assert_equal_s().
2013-01-25 06:55:56 +01:00
Ben Straub
54b2a37ac7 Clean up config.h 2012-11-27 13:18:28 -08:00
yorah
a1abe66aca Add config level support in the config API
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-23 12:48:38 +02:00
yorah
f8ede94808 Fix adding variable to config file with no trailing newline
This can occur after a manual modification of a config file.
2012-10-23 11:48:50 +02:00
Carlos Martín Nieto
67d334c1cd config: add more tests for writing escaped chars 2012-06-13 23:26:00 +02:00
Adam Roben
750be86aed Add a test that shows we don't preserve quotes in config values 2012-06-13 21:43:34 +02:00
Vicent Martí
904b67e69f errors: Rename error codes 2012-05-18 01:48:50 +02:00
Vicent Martí
e172cf082e errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
Vicent Martí
255c38c500 global: Fix unit tests after reordering 2012-05-18 01:25:57 +02:00
Carlos Martín Nieto
54fef6ebcb config: write out section headers with subsections correctly
write_section() mistakenly treated is input as the whole variable name
instead of simply the section (and possibly subsection) and would
confuse "section.subsection" as a section plus variable name and
produce a wrong section header.

Fix this and include a test for writing "section.subsection.var" and
reading it from the file.
2012-03-09 20:43:17 +01:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00