From 290483010cfc7945cd4483fadd1d98c3b83efb3c Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 29 Apr 2015 00:46:02 +0000 Subject: GitDir: Set the fetch or push url when the other is set Change-Id: I500cb81fd0f133bd9f4e76d46bc0ff8a4f57fe50 --- morphlib/gitdir.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.1