]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/combo-layer: specify branch when getting current revision
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 21 Aug 2012 13:17:10 +0000 (14:17 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 Aug 2012 10:15:50 +0000 (11:15 +0100)
Handle the case during update where the configured branch is not
currently checked out in the component repository by just specifying
it in the places where it was not previously.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
scripts/combo-layer

index 448fe71cd9c0ea67d949b8812c70315431cab524..330faca3893f1d5f8b83fad7bd2168776b70a1e0 100755 (executable)
@@ -191,7 +191,7 @@ def action_init(conf, args):
             branch = repo.get('branch', "master")
             file_filter = repo.get('file_filter', "")
             runcmd("git archive %s | tar -x -C %s %s" % (branch, extract_dir, file_filter), ldir)
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
             conf.update(name, "last_revision", lastrev, initmode=True)
         runcmd("git add .")
         if conf.localconffile:
@@ -475,7 +475,8 @@ def apply_patchlist(conf, repos):
         else:
             logger.info("No patches to apply from %s" % name)
             ldir = conf.repos[name]['local_repo_dir']
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            branch = conf.repos[name].get('branch', "master")
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
 
         if lastrev != repo['last_revision']:
             conf.update(name, "last_revision", lastrev)