diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-04-29 00:46:02 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-04-29 11:32:51 +0000 |
commit | 290483010cfc7945cd4483fadd1d98c3b83efb3c (patch) | |
tree | cc49bcc9cf99679a8199c7cca6b93df3c319dd54 /morphlib/gitdir.py | |
parent | 9e074be3d862c92a47474fa613465e178944d00b (diff) | |
download | morph-290483010cfc7945cd4483fadd1d98c3b83efb3c.tar.gz |
GitDir: Set the fetch or push url when the other is set
Change-Id: I500cb81fd0f133bd9f4e76d46bc0ff8a4f57fe50
Diffstat (limited to 'morphlib/gitdir.py')
-rw-r--r-- | morphlib/gitdir.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index 70f9db01..021f35ea 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -249,12 +249,16 @@ class Remote(object): if self.name is not None: morphlib.git.gitcmd(self.gd._runcmd, 'remote', 'set-url', self.name, url) + if self.push_url is None: + self.set_push_url(url) def set_push_url(self, url): self.push_url = url if self.name is not None: morphlib.git.gitcmd(self.gd._runcmd, 'remote', 'set-url', '--push', self.name, url) + if self.fetch_url is None: + self.set_fetch_url(url) def _get_remote_url(self, remote_name, kind): # As distasteful as it is to parse the output of porcelain |