diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-05-03 18:39:02 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-05-04 14:30:00 +0100 |
commit | 3fe9adac5bedbd9b419b9dd1447999be3555baf1 (patch) | |
tree | 111209dc394caa44c6ec13349cdf69846e90614a | |
parent | 3e8ff6853ab9e645274b8aa05e5c8ee3bd84e095 (diff) | |
download | morph-3fe9adac5bedbd9b419b9dd1447999be3555baf1.tar.gz |
Add push URL rewrite rule to "morph edit"'d repo
-rwxr-xr-x | morph | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |