changeset 562:e188e780977b

Use local-master as default local branch name if no branch is set in the config If a branch is set use branch name also as local branch name
author Bjoern Ricks <bricks@intevation.de>
date Fri, 02 Sep 2011 09:47:42 +0000
parents 1f7746e2288e
children a4efa91bc3b2
files treepkg/git.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/git.py	Fri Sep 02 09:43:21 2011 +0000
+++ b/treepkg/git.py	Fri Sep 02 09:47:42 2011 +0000
@@ -36,15 +36,17 @@
                     defaults to master
         """
         self.url = url
-        self.local_branch = "local"
-        self.branch = branch
         if not branch:
+            # as default track master as local-master
+            self.local_branch = "local-master"
             self.branch = "master"
+        else:
+            self.local_branch = branch
+            self.branch = branch
         if ":" in self.branch:
             branches = self.branch.split(":")
             self.local_branch = branches[0]
             self.branch = branches[1]
-        # use master as default
 
     def checkout(self, localdir):
         """Clones the repository at url into the localdir"""
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)