diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-07-11 18:21:29 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-07-11 18:21:29 +0200 |
commit | de3b9639a4c2933ebb0f11ad288514cda83c54fe (patch) | |
tree | 77343f44862ff48025b1459a08c085cc1661c854 | |
parent | 258403da9c2a087b10082d26466528fce3de38d4 (diff) | |
download | gitpython-de3b9639a4c2933ebb0f11ad288514cda83c54fe.tar.gz |
Moved test-centric windows specific fix into the class itself to assure this kind of issue doesn't popup for anyone
-rw-r--r-- | lib/git/remote.py | 11 | ||||
-rw-r--r-- | test/testlib/helper.py | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/git/remote.py b/lib/git/remote.py index 801dcd62..8442e809 100644 --- a/lib/git/remote.py +++ b/lib/git/remote.py @@ -25,6 +25,7 @@ from gitdb.util import ( join, ) import re +import os __all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote') @@ -418,6 +419,16 @@ class Remote(LazyMixin, Iterable): self.repo = repo self.name = name + if os.name == 'nt': + # some oddity: on windows, python 2.5, it for some reason does not realize + # that it has the config_writer property, but instead calls __getattr__ + # which will not yield the expected results. 'pinging' the members + # with a dir call creates the config_writer property that we require + # ... bugs like these make me wonder wheter python really wants to be used + # for production. It doesn't happen on linux though. + dir(self) + # END windows special handling + def __getattr__(self, attr): """Allows to call this instance like remote.special( *args, **kwargs) to call git-remote special self.name""" diff --git a/test/testlib/helper.py b/test/testlib/helper.py index 49a01bf7..b5b6fad7 100644 --- a/test/testlib/helper.py +++ b/test/testlib/helper.py @@ -188,13 +188,6 @@ def with_rw_and_rw_remote_repo(working_tree_ref): d_remote.fetch() remote_repo_url = "git://localhost%s" % remote_repo_dir - # some oddity: on windows, python 2.5, it for some reason does not realize - # that it has the config_writer property, but instead calls __getattr__ - # which will not yield the expected results. 'pinging' the members - # with a dir call creates the config_writer property that we require - # ... bugs like these make me wonder wheter python really wants to be used - # for production. It doesn't happen on linux though. - dir(d_remote) d_remote.config_writer.set('url', remote_repo_url) # try to list remotes to diagnoes whether the server is up |