summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-03 18:39:02 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-04 14:30:00 +0100
commit3fe9adac5bedbd9b419b9dd1447999be3555baf1 (patch)
tree111209dc394caa44c6ec13349cdf69846e90614a /morph
parent3e8ff6853ab9e645274b8aa05e5c8ee3bd84e095 (diff)
downloadmorph-3fe9adac5bedbd9b419b9dd1447999be3555baf1.tar.gz
Add push URL rewrite rule to "morph edit"'d repo
Diffstat (limited to 'morph')
-rwxr-xr-xmorph7
1 files changed, 7 insertions, 0 deletions
diff --git a/morph b/morph
index 291caf79..bcc02d5b 100755
--- a/morph
+++ b/morph
@@ -616,6 +616,13 @@ class Morph(cliapp.Application):
# Set the origin to point at the original repository.
morphlib.git.set_remote(dirname, 'origin', repo.url)
+ # Add push url rewrite rule to .git/config.
+ filename = os.path.join(dirname, '.git', 'config')
+ with open(filename, 'a') as f:
+ f.write('\n')
+ f.write('[url "%s"]\n' % cache.push_url(reponame))
+ f.write('pushInsteadOf = %s\n' % cache.pull_url(reponame))
+
# Update remotes.
self.runcmd(['git', 'remote', 'update'], cwd=dirname)