add branch support to the git fetcher -- thanks Otavio Salvador.
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>
Fri, 18 Jan 2008 20:26:18 +0000 (20:26 +0000)
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>
Fri, 18 Jan 2008 20:26:18 +0000 (20:26 +0000)
ChangeLog
lib/bb/fetch/git.py

index 1b1a9f4..71ce6f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@ Changes in BitBake 1.8.x:
        - Fix shell data updating problems (#1880)
        - Properly raise errors for invalid source URI protocols
        - Change the wget fetcher failure handling to avoid lockfile problems
+        - Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
 
 Changes in Bitbake 1.8.8:
        - Rewrite svn fetcher to make adding extra operations easier 
index 21259a2..9cc7f4e 100644 (file)
@@ -50,6 +50,8 @@ class Git(Fetch):
         if 'protocol' in ud.parm:
             ud.proto = ud.parm['protocol']
 
+        ud.branch = ud.parm.get("branch", "")
+
         tag = Fetch.srcrev_internal_helper(ud, d)
         if tag is True:
             ud.tag = self.latest_revision(url, ud, d)  
@@ -130,7 +132,8 @@ class Git(Fetch):
 
     def _latest_revision(self, url, ud, d):
 
-        output = runfetchcmd("git ls-remote %s://%s%s" % (ud.proto, ud.host, ud.path), d, True)
+        bb.msg.note(1, bb.msg.domain.Fetcher, "Calling git ls-remote %s://%s%s %s" % (ud.proto, ud.host, ud.path, ud.branch ) )
+        output = runfetchcmd("git ls-remote %s://%s%s %s" % (ud.proto, ud.host, ud.path, ud.branch), d, True)
         return output.split()[0]
 
     def _build_revision(self, url, ud, d):