From: Junio C Hamano Date: Mon, 15 May 2006 20:48:22 +0000 (-0700) Subject: Merge branch 'fix' X-Git-Tag: v1.4.0-rc1~144 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d55aaefa3e3920bdf9a52d80da2a244f72742228;p=git.git Merge branch 'fix' * fix: Fix pack-index issue on 64-bit platforms a bit more portably. Install git-send-email by default Fix compilation on newer NetBSD systems git config syntax updates Another config file parsing fix. checkout: use --aggressive when running a 3-way merge (-m). --- d55aaefa3e3920bdf9a52d80da2a244f72742228 diff --cc repo-config.c index 63eda1bb7,58b6c5284..284af2273 --- a/repo-config.c +++ b/repo-config.c @@@ -65,20 -48,14 +65,22 @@@ static int show_config(const char* key_ 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 t/t1300-repo-config.sh index 7090ea92c,028d15956..8260d57b6 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@@ -247,24 -247,6 +247,24 @@@ EO test_expect_success 'hierarchical section value' 'cmp .git/config expect' +cat > expect << EOF +beta.noindent=sillyValue +nextsection.nonewline=wow2 for me +123456.a123=987 - 1.2.3.alpha=beta ++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