summaryrefslogtreecommitdiff
path: root/lib/git/repo/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-20 16:18:01 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-20 16:18:01 +0200
commit192472f9673b18c91ce618e64e935f91769c50e7 (patch)
tree11fa568ea41d3856e6df605c8c8c8559fded3745 /lib/git/repo/base.py
parent89422841e46efa99bda49acfbe33ee1ca5122845 (diff)
downloadgitpython-192472f9673b18c91ce618e64e935f91769c50e7.tar.gz
BaseIndexEntry: Added to_blob method, refactored functionality sligthly
repo.clone: assured backslashes won't reach the remote configuration, as it can cause trouble when re-reading the file later on. Some git commands don't appear to be able to properly deal with backslashes, other's do
Diffstat (limited to 'lib/git/repo/base.py')
-rw-r--r--lib/git/repo/base.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/git/repo/base.py b/lib/git/repo/base.py
index 4456b1e9..790b1283 100644
--- a/lib/git/repo/base.py
+++ b/lib/git/repo/base.py
@@ -651,7 +651,17 @@ class Repo(object):
# environment, hence we prepend its working dir if required
if not os.path.isabs(path) and git.working_dir:
path = join(git._working_dir, path)
- return cls(os.path.abspath(path), odbt = odbt)
+
+ # adjust remotes - there may be operating systems which use backslashes,
+ # These might be given as initial paths, but when handling the config file
+ # that contains the remote from which we were clones, git stops liking it
+ # as it will escape the backslashes. Hence we undo the escaping just to be
+ # sure
+ repo = cls(os.path.abspath(path), odbt = odbt)
+ if repo.remotes:
+ repo.remotes[0].config_writer.set_value('url', repo.remotes[0].url.replace("\\\\", "\\").replace("\\", "/"))
+ # END handle remote repo
+ return repo
def clone(self, path, **kwargs):
"""Create a clone from this repository.