summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 18:30:29 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 18:30:29 +0000
commitb7d9eadd7996603cb6f5c1e9f844b3531fc8af41 (patch)
tree2a016e6a7b91c3b6fa66c040d4f8036d286a99ab /morph
parent68f87d4b837fb1eb45934ceda5de21160a4eb639 (diff)
downloadmorph-b7d9eadd7996603cb6f5c1e9f844b3531fc8af41.tar.gz
Make "morph edit" work with existing branches, and fix "morph merge" pulling right
Diffstat (limited to 'morph')
-rwxr-xr-xmorph7
1 files changed, 5 insertions, 2 deletions
diff --git a/morph b/morph
index 377fc787..06548f9b 100755
--- a/morph
+++ b/morph
@@ -489,7 +489,10 @@ class Morph(cliapp.Application):
self._clone_to_directory(new_repo, repo, ref)
system_branch = self._deduce_system_branch()
- if system_branch != ref:
+ if system_branch == ref:
+ self.runcmd(['git', 'checkout', system_branch],
+ cwd=new_repo)
+ else:
self.runcmd(['git', 'checkout', '-b', system_branch, ref],
cwd=new_repo)
@@ -508,7 +511,7 @@ class Morph(cliapp.Application):
basename = os.path.basename(repo)
pull_from = os.path.join(mine, other_branch, basename)
repo_dir = os.path.join(mine, this_branch, basename)
- self.runcmd(['git', 'pull', pull_from], cwd=repo_dir)
+ self.runcmd(['git', 'pull', pull_from, other_branch], cwd=repo_dir)
def msg(self, msg):
'''Show a message to the user about what is going on.'''