From 3fe9adac5bedbd9b419b9dd1447999be3555baf1 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 3 May 2012 18:39:02 +0100 Subject: Add push URL rewrite rule to "morph edit"'d repo --- morph | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'morph') 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) -- cgit v1.2.1