diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 18:53:55 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 18:53:55 +0200 |
commit | 048acc4596dc1c6d7ed3220807b827056cb01032 (patch) | |
tree | 448259c37aa52e7bada2ec6c642160ee99c21670 /lib/git/config.py | |
parent | a07cdbae1d485fd715a5b6eca767f211770fea4d (diff) | |
download | gitpython-048acc4596dc1c6d7ed3220807b827056cb01032.tar.gz |
Added configuration access including tests to remote
config: fixed issue that would cause it to abort reading if the file did not exist - this is valid now
Test does not work as the configuration parsing does not work as expected - this must be fixed first
Diffstat (limited to 'lib/git/config.py')
-rw-r--r-- | lib/git/config.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/git/config.py b/lib/git/config.py index b555677e..75207075 100644 --- a/lib/git/config.py +++ b/lib/git/config.py @@ -223,13 +223,14 @@ class GitConfigParser(cp.RawConfigParser, object): def read(self): """ - Reads the data stored in the files we have been initialized with + Reads the data stored in the files we have been initialized with. It will + ignore files that cannot be read, possibly leaving an empty configuration Returns Nothing Raises - IOError if not all files could be read + IOError if a file cannot be handled """ if self._is_initialized: return @@ -244,7 +245,10 @@ class GitConfigParser(cp.RawConfigParser, object): close_fp = False # assume a path if it is not a file-object if not hasattr(file_object, "seek"): - fp = open(file_object) + try: + fp = open(file_object) + except IOError,e: + continue close_fp = True # END fp handling |