]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake/fetch2/git: Don't set the branch name to None, that makes no sense
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 May 2012 17:14:40 +0000 (18:14 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 13 May 2012 18:58:19 +0000 (19:58 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/git.py

index bcc0da583bc2a6be3b858a3960ff297491dd1a1b..5efdfa9ca6d977eea60019b6dfa12e624fc6d8c3 100644 (file)
@@ -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('/', '.'))