]> source.dussan.org Git - jgit.git/commit
Config: Drop backslash in invalid escape sequences in subsections 91/114591/2
authorDave Borowitz <dborowitz@google.com>
Thu, 21 Dec 2017 13:55:45 +0000 (08:55 -0500)
committerDave Borowitz <dborowitz@google.com>
Thu, 21 Dec 2017 14:30:52 +0000 (09:30 -0500)
commitbe224f8d4c6afb9603c4f824e91e639c9f99cc7a
tree41b8bab0adfd71523c07b1e621539a868e482548
parentfa24425c608e0983580fa81743de9cfda9faac2e
Config: Drop backslash in invalid escape sequences in subsections

These are ignored by C git when parsing:

$ git config -f - --list <<EOF
[foo "x\0y"]
bar = baz
[foo "x\qy"]
bar = baz
[foo "x\by"]
bar = baz
[foo "x\ny"]
bar = baz
[foo "x\ty"]
bar = baz
EOF
foo.x0y.bar=baz
foo.xqy.bar=baz
foo.xby.bar=baz
foo.xny.bar=baz
foo.xty.bar=baz

This behavior is different from value parsing, where an invalid escape
sequence is an error (which JGit already does as well):

$ git config -f - --list <<EOF
[foo]
bar = x\qy
EOF
fatal: bad config line 2 in standard input

Change-Id: Ifd40129b37d9a62df3d886d8d7e22f766f54e9d1
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java