changeset 547:70fa7debabed

checkout git branch on update this may be necessary if a treepkg config has changed and a branch is used instead of master
author Bjoern Ricks <bricks@intevation.de>
date Wed, 02 Feb 2011 10:26:02 +0000
parents 149d18aca4f7
children 6b6cd977785c
files treepkg/git.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/git.py	Wed Feb 02 10:00:48 2011 +0000
+++ b/treepkg/git.py	Wed Feb 02 10:26:02 2011 +0000
@@ -28,9 +28,12 @@
         run.call(cmdexpand("git checkout -q --track -b local $branch",
                             **locals()), cwd=localdir)
 
-def update(localdir, revision=None):
+def update(localdir, branch=None):
     """Runs git pull on the localdir."""
     run.call(cmdexpand("git pull -q"), cwd=localdir)
+    if branch:
+        run.call(cmdexpand("git checkout -q $branch", branch=branch),
+                cwd=localdir)
 
 def export(src, dest):
     """Exports the local branch from src to dest"""
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)