[damned-lies] Checkout and update git submodules, if a module has any, fixes #688325



commit 18d3f63a14a4e32e124c675f3bc91de6ff453c30
Author: Gil Forcada <gforcada gnome org>
Date:   Sat Dec 15 19:32:10 2012 +0100

    Checkout and update git submodules, if a module has any, fixes #688325

 stats/models.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index e0b51bc..3bf4521 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -588,6 +588,10 @@ class Branch(models.Model):
                     "localdir" : modulepath,
                     "branch" : self.name,
                     })
+                # check if there are any submodules and init & update them
+                commandList.append("cd \"%(localdir)s\" && if [ -e .gitmodules ]; then git submodule update --init; fi" % {
+                    "localdir" : modulepath,
+                    })
             elif vcs_type == "bzr":
                 commandList.append("cd \"%(localdir)s\" && bzr up" % {
                     "localdir" : modulepath,
@@ -641,6 +645,10 @@ class Branch(models.Model):
                         "localdir" : modulepath,
                         "branch" : self.name,
                         })
+                # check if there are any submodules and init & update them
+                commandList.append("cd \"%(localdir)s\" && if [ -e .gitmodules ]; then git submodule update --init; fi" % {
+                        "localdir" : modulepath,
+                        })
             elif vcs_type == "bzr":
                 commandList.append("cd \"%(localroot)s\" && bzr co --lightweight %(bzrpath)s \"%(dir)s\"" % {
                     "localroot" : localroot,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]