Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97d0c5c

Browse files
committed
Test that ConfigParser treats empty quotes as an empty value
The ConfigParser has supported this for a long time, but it is now done redundantly since gitpython-developers#2035. This adds a test for it, both to make clearer that it is intended to work and to allow verifying that it continues to hold once the legacy special-casing for it is removed.
1 parent 63160de commit 97d0c5c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[core]
2+
filemode = ""

test/test_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ def test_config_with_quotes(self):
416416
self.assertEqual(cr.get("user", "name"), "Cody Veal")
417417
self.assertEqual(cr.get("user", "email"), "[email protected]")
418418

419+
def test_config_with_empty_quotes(self):
420+
cr = GitConfigParser(fixture_path("git_config_with_empty_quotes", read_only=True))
421+
self.assertEqual(cr.get("core", "filemode"), "", "quotes can form a literal empty string as value")
422+
419423
def test_config_with_quotes_with_literal_whitespace(self):
420424
cr = GitConfigParser(fixture_path("git_config_with_quotes_whitespace_inside"), read_only=True)
421425
self.assertEqual(cr.get("core", "commentString"), "# ")

0 commit comments

Comments
 (0)