From: Alex Vandiver <alex@chmrr.net>
To: git@vger.kernel.org
Subject: [PATCH] Failing test; renaming sections can lose assignments on the same line
Date: Wed, 8 Jul 2009 16:40:41 -0400 [thread overview]
Message-ID: <1247085641-14772-1-git-send-email-alex@chmrr.net> (raw)
Signed-off-by: Alex Vandiver <alex@chmrr.net>
---
I noticed the following bug recently:
echo "[foo] x = 1" > testfile
git config --file=testfile --rename-section foo bar
cat testfile
# [bar]
This is at least a failing test, and I'll look at how complex the
fix is when I get a few spare tuits.
t/t1300-repo-config.sh | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 43ea283..4d576c6 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -460,6 +460,27 @@ EOF
test_expect_success "rename succeeded" "test_cmp expect .git/config"
cat >> .git/config << EOF
+[branch "vier"] z = 1
+EOF
+
+test_expect_success "rename a section with a var on the same line" \
+ 'git config --rename-section branch.vier branch.zwei'
+
+cat > expect << EOF
+# Hallo
+ #Bello
+[branch "zwei"]
+ x = 1
+[branch "zwei"]
+ y = 1
+[branch "drei"]
+weird
+[branch "zwei"] z = 1
+EOF
+
+test_expect_success "rename succeeded" "test_cmp expect .git/config"
+
+cat >> .git/config << EOF
[branch "zwei"] a = 1 [branch "vier"]
EOF
--
1.6.3.3.473.gb74fc4.dirty
reply other threads:[~2009-07-08 21:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1247085641-14772-1-git-send-email-alex@chmrr.net \
--to=alex@chmrr.net \
--cc=git@vger.kernel.org \
/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).