Skip to contentSkip to conversation

Append the password to the username on git URI reassembling.

PATCH In review [email protected] 3 participants 3 messages Nov 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Append the password to the username on git URI reassembling.

This allows the users to specify SRC_URIs of the form

git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

---
 lib/bb/fetch2/git.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/git.py +4 -1
index b97967b4..090fa173 100644
@@ -596,7 +596,10 @@ class Git(FetchMethod):
         Return the repository URL
         """
         if ud.user:
-            username = ud.user + '@'
+            username = ud.user
+            if ud.pswd:
+                username += ":" + ud.pswd
+            username += "@"
         else:
             username = ""
         return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
Signature · 1 line
2.25.1