diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 9ba9cdccc7..ac996fa166 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -140,6 +140,10 @@ class Git(FetchMethod): | |||
140 | ud.proto = 'file' | 140 | ud.proto = 'file' |
141 | else: | 141 | else: |
142 | ud.proto = "git" | 142 | ud.proto = "git" |
143 | if ud.host == "github.com" and ud.proto == "git": | ||
144 | # github stopped supporting git protocol | ||
145 | # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git | ||
146 | ud.proto = "https" | ||
143 | 147 | ||
144 | if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'): | 148 | if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'): |
145 | raise bb.fetch2.ParameterError("Invalid protocol type", ud.url) | 149 | raise bb.fetch2.ParameterError("Invalid protocol type", ud.url) |
@@ -355,7 +359,7 @@ class Git(FetchMethod): | |||
355 | runfetchcmd("%s remote rm origin" % ud.basecmd, d, workdir=ud.clonedir) | 359 | runfetchcmd("%s remote rm origin" % ud.basecmd, d, workdir=ud.clonedir) |
356 | 360 | ||
357 | runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d, workdir=ud.clonedir) | 361 | runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d, workdir=ud.clonedir) |
358 | fetch_cmd = "LANG=C %s fetch -f --prune --progress %s refs/*:refs/*" % (ud.basecmd, repourl) | 362 | fetch_cmd = "LANG=C %s fetch -f --progress %s refs/*:refs/*" % (ud.basecmd, repourl) |
359 | if ud.proto.lower() != 'file': | 363 | if ud.proto.lower() != 'file': |
360 | bb.fetch2.check_network_access(d, fetch_cmd, ud.url) | 364 | bb.fetch2.check_network_access(d, fetch_cmd, ud.url) |
361 | progresshandler = GitProgressHandler(d) | 365 | progresshandler = GitProgressHandler(d) |