Skip to contentSkip to conversation

bitbake/fetch2/git: Don't set the branch name to None, that makes no sense

PATCH New Richard Purdie 1 participant 1 message May 11, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake/fetch2/git: Don't set the branch name to None, that makes no sense

With floating revisions and no specified branch, the fetcher could fail with some obtuse errors. This was due to the branch name being set to None which makes no sense. This patch reworks some conditions to avoid this.

---

bitbake/lib/bb/fetch2/git.py +2 -1
index bcc0da5..5efdfa9 100644
@@ -123,7 +123,8 @@ class Git(FetchMethod):
         for name in ud.names:
             # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
             if not ud.revisions[name] or len(ud.revisions[name]) != 40  or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
-                ud.branches[name] = ud.revisions[name]
+                if ud.revisions[name]:
+                    ud.branches[name] = ud.revisions[name]
                 ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
 
         gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.'))