浏览代码

fetch/git.py: Add username handling to git fetcher (from Poky)

Richard Purdie 15 年之前
父节点
当前提交
fdd4ccc42c
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 1 0
      ChangeLog
  2. 6 1
      lib/bb/fetch/git.py

+ 1 - 0
ChangeLog

@@ -172,6 +172,7 @@ Changes in Bitbake 1.9.x:
 	- Add bb.utils.prune_suffix function
 	- Fix hg checkouts of specific revisions (from Poky)
 	- Fix wget fetching of urls with parameters specified (from Poky)
+	- Add username handling to git fetcher (from Poky)
 
 Changes in Bitbake 1.8.0:
 	- Release 1.7.x as a stable series

+ 6 - 1
lib/bb/fetch/git.py

@@ -134,7 +134,12 @@ class Git(Fetch):
         """
         Compute the HEAD revision for the url
         """
-        output = runfetchcmd("git ls-remote %s://%s%s %s" % (ud.proto, ud.host, ud.path, ud.branch), d, True)
+        if ud.user:
+            username = ud.user + '@'
+        else:
+            username = ""
+
+        output = runfetchcmd("git ls-remote %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d, True)
         return output.split()[0]
 
     def _build_revision(self, url, ud, d):