From 61d16f0a6e4e11ced051883117008d00e761d666 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 27 May 2011 20:43:25 -0700 Subject: [PATCH] Strip the line when matching for sections The SECTCRE regex does not seem to ignore leading spaces before a section in the config and will cause a traceback. However git itself parses these files just fine. Stripping the line resolves the issue. https://bugzilla.redhat.com/show_bug.cgi?id=706218 --- git/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/config.py b/git/config.py index 209f2ffef..d5256e0d6 100644 --- a/git/config.py +++ b/git/config.py @@ -218,7 +218,7 @@ def _read(self, fp, fpname): continue else: # is it a section header? - mo = self.SECTCRE.match(line) + mo = self.SECTCRE.match(line.strip()) # strip the line to remove leading spaces if mo: sectname = mo.group('header') if sectname in self._sections: