From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Thomas Rast <tr@thomasrast.ch>, Jeff King <peff@peff.net>
Subject: [PATCH] fixup! config: arbitrary number of matches for --unset and --replace-all
Date: Fri, 6 Dec 2013 10:46:42 -0800 [thread overview]
Message-ID: <1386355602-21818-1-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <06ba1524cbe4fa31b6e1a8d644882521aeaff4f4.1384337608.git.tr@thomasrast.ch>
---
* I'll squash this to tr/config-multivalue-lift-max in preparation
for merging it to 'master',which should happen by the end of
this week.
Thanks.
config.c | 8 ++++----
t/t1303-wacky-config.sh | 14 +++++++-------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/config.c b/config.c
index 431dcb7..a1e80da 100644
--- a/config.c
+++ b/config.c
@@ -1192,7 +1192,7 @@ static int store_aux(const char *key, const char *value, void *cb)
warning("%s has multiple values", key);
}
- ALLOC_GROW(store.offset, store.seen+1,
+ ALLOC_GROW(store.offset, store.seen + 1,
store.offset_alloc);
store.offset[store.seen] = cf->do_ftell(cf);
@@ -1222,14 +1222,14 @@ static int store_aux(const char *key, const char *value, void *cb)
* Do not increment matches: this is no match, but we
* just made sure we are in the desired section.
*/
- ALLOC_GROW(store.offset, store.seen+1,
+ ALLOC_GROW(store.offset, store.seen + 1,
store.offset_alloc);
store.offset[store.seen] = cf->do_ftell(cf);
/* fallthru */
case SECTION_END_SEEN:
case START:
if (matches(key, value)) {
- ALLOC_GROW(store.offset, store.seen+1,
+ ALLOC_GROW(store.offset, store.seen + 1,
store.offset_alloc);
store.offset[store.seen] = cf->do_ftell(cf);
store.state = KEY_SEEN;
@@ -1239,7 +1239,7 @@ static int store_aux(const char *key, const char *value, void *cb)
!strncmp(key, store.key, store.baselen)) {
store.state = SECTION_SEEN;
ALLOC_GROW(store.offset,
- store.seen+1,
+ store.seen + 1,
store.offset_alloc);
store.offset[store.seen] = cf->do_ftell(cf);
}
diff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh
index 7d55730..3a2c819 100755
--- a/t/t1303-wacky-config.sh
+++ b/t/t1303-wacky-config.sh
@@ -66,13 +66,13 @@ setup_many() {
# Semi-efficient way of concatenating 5^5 = 3125 lines. Note
# that because 'setup' already put one line, this means 3126
# entries for section.key in the config file.
- cat >5to1 <<EOF
- key = foo
- key = foo
- key = foo
- key = foo
- key = foo
-EOF
+ cat >5to1 <<-\EOF &&
+ key = foo
+ key = foo
+ key = foo
+ key = foo
+ key = foo
+ EOF
cat 5to1 5to1 5to1 5to1 5to1 >5to2 && # 25
cat 5to2 5to2 5to2 5to2 5to2 >5to3 && # 125
cat 5to3 5to3 5to3 5to3 5to3 >5to4 && # 635
--
1.8.5.1-402-gdd8f092
next prev parent reply other threads:[~2013-12-06 18:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 15:31 Bug with git svn fetch? "error:too many matches for svn-remote.svn.added-placeholder" Jess Hottenstein
2013-11-13 10:19 ` [PATCH] config: arbitrary number of matches for --unset and --replace-all Thomas Rast
2013-11-13 23:22 ` Eric Sunshine
2013-11-14 7:50 ` Thomas Rast
2013-11-14 8:37 ` Jeff King
2013-11-14 20:24 ` Thomas Rast
2013-12-06 18:46 ` Junio C Hamano [this message]
2013-12-06 21:10 ` [PATCH] fixup! " Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386355602-21818-1-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=tr@thomasrast.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).