changeset 216:85052c5ab8f1

hopefully fix up git magic --work-tree magic
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 09 Feb 2011 14:52:17 -0800
parents 9eded49afdad
children 5148132de9b6
files autobot/changes/poller.py autobot/process/factory.py
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/changes/poller.py	Wed Feb 09 12:19:34 2011 -0800
+++ b/autobot/changes/poller.py	Wed Feb 09 14:52:17 2011 -0800
@@ -428,8 +428,10 @@
         """commands needed to initialize the repository"""
         commands = [ [ 'clone', self.repourl, self.workdir ] ]
         if self.branch != 'master':
-            git_dir = self.workdir.rstrip('/') + '/.git'
-            commands.append(['--git-dir', git_dir, 'checkout', self.branch])
+            git_dir = self.workdir.rstrip('/')
+            commands.append(['--git-dir', git_dir + '/.git',
+                             '--work-tree', git_dir,
+                             'checkout', self.branch])
         return commands
 
     def update(self, _):
--- a/autobot/process/factory.py	Wed Feb 09 12:19:34 2011 -0800
+++ b/autobot/process/factory.py	Wed Feb 09 14:52:17 2011 -0800
@@ -143,8 +143,10 @@
       self.addStep(ShellCommand(command=['git', 'clone', git_source],
                                 **kwargs))
       if branch and branch != 'master':
-        dirname = self.dirname('git', git_source) + '/.git'
-        self.addStep(ShellCommand(command=['git', '--git-dir', dirname, 'checkout', branch],
+        dirname = self.dirname('git', git_source)
+        self.addStep(ShellCommand(command=['git', '--git-dir', dirname + '/.git', 
+                                           '--work-tree', dirname,
+                                           'checkout', branch],
                                   **kwargs))
 
   def dirname(self, type, repo):