author | Junio C Hamano <junkio@cox.net> | |
Sat, 13 May 2006 21:10:48 +0000 (14:10 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 13 May 2006 21:11:43 +0000 (14:11 -0700) |
* lt/fix-config:
git config syntax updates
Another config file parsing fix.
checkout: use --aggressive when running a 3-way merge (-m).
Fix git-pack-objects for 64-bit platforms
with manual adjustment of t/t1300 for "git repo-config --list" option.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git config syntax updates
Another config file parsing fix.
checkout: use --aggressive when running a 3-way merge (-m).
Fix git-pack-objects for 64-bit platforms
with manual adjustment of t/t1300 for "git repo-config --list" option.
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 | 2 | |||
---|---|---|---|---|
pack-objects.c | patch | | diff1 | | diff2 | | blob | history |
repo-config.c | patch | | diff1 | | diff2 | | blob | history |
sha1_file.c | patch | | diff1 | | diff2 | | blob | history |
t/t1300-repo-config.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc pack-objects.c
Simple merge
diff --cc repo-config.c
index 63eda1bb783fcb9ff72843e74383abb0f0581441,58b6c5284fa806ddda70e84d3871415ba26c893f..127afd784c1fcdb531c1d3435f724d0041151e90
--- 1/repo-config.c
--- 2/repo-config.c
+++ b/repo-config.c
static int get_value(const char* key_, const char* regex_)
{
-- int i;
+ char *tl;
- key = malloc(strlen(key_)+1);
- for (i = 0; key_[i]; i++)
- key[i] = tolower(key_[i]);
- key[i] = 0;
+ key = strdup(key_);
+ for (tl=key+strlen(key)-1; tl >= key && *tl != '.'; --tl)
+ *tl = tolower(*tl);
+ for (tl=key; *tl && *tl != '.'; ++tl)
+ *tl = tolower(*tl);
+ if (use_key_regexp) {
+ key_regexp = (regex_t*)malloc(sizeof(regex_t));
+ if (regcomp(key_regexp, key, REG_EXTENDED)) {
+ fprintf(stderr, "Invalid key pattern: %s\n", key_);
+ return -1;
+ }
+ }
+
if (regex_) {
if (regex_[0] == '!') {
do_not_match = 1;
diff --cc sha1_file.c
Simple merge
diff --cc t/t1300-repo-config.sh
index 7090ea92c1ace40079493447d12fc61da416cb9c,028d15956bb4c18a6adf5d91b934ae060608ecbb..8260d57b63d7f988a4c236d99ce2c9931a67c5e3
+++ b/t/t1300-repo-config.sh
test_expect_success 'hierarchical section value' 'cmp .git/config expect'
- 1.2.3.alpha=beta
+cat > expect << EOF
+beta.noindent=sillyValue
+nextsection.nonewline=wow2 for me
+123456.a123=987
++version.1.2.3eX.alpha=beta
+EOF
+
+test_expect_success 'working --list' \
+ 'git-repo-config --list > output && cmp output expect'
+
+cat > expect << EOF
+beta.noindent sillyValue
+nextsection.nonewline wow2 for me
+EOF
+
+test_expect_success '--get-regexp' \
+ 'git-repo-config --get-regexp in > output && cmp output expect'
+
cat > .git/config << EOF
[novalue]
variable