diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-29 11:08:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-03 10:12:42 +0000 |
commit | d576d9ca3a5e852ccfb1506e2df9fc09a9e30f52 (patch) | |
tree | 35426dd6511c3d2695cb7f1d5c865962df898a3e | |
parent | 5acc6975063b82e34aa99366fedb1ce5c4238f70 (diff) | |
download | poky-d576d9ca3a5e852ccfb1506e2df9fc09a9e30f52.tar.gz |
bitbake: fetch2/git: Add a warning asking users to set a branch in git urls
There is much uncertainty around what tools and hosting providers will
do about default git branch naming in the future. To help ensure we
can handle the various scenarios, we will make branch names required in
SRC_URI. To start that process, show users a warning if it isn't set.
This may also allow us to change the default at some point in the future.
(Bitbake rev: 86a9c26828479be55865bcce72bcc7e12b93caa7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 51b616bad7..4186295cdd 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -165,7 +165,10 @@ class Git(FetchMethod): | |||
165 | ud.nocheckout = 1 | 165 | ud.nocheckout = 1 |
166 | 166 | ||
167 | ud.unresolvedrev = {} | 167 | ud.unresolvedrev = {} |
168 | branches = ud.parm.get("branch", "master").split(',') | 168 | branches = ud.parm.get("branch", "").split(',') |
169 | if branches == [""] and not ud.nobranch: | ||
170 | bb.warn("URL: %s does not set any branch parameter. The future default branch used by tools and repositories is uncertain and we will therefore soon require this is set in all git urls." % ud.url) | ||
171 | branches = ["master"] | ||
169 | if len(branches) != len(ud.names): | 172 | if len(branches) != len(ud.names): |
170 | raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) | 173 | raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) |
171 | 174 | ||