diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2025-09-05 08:20:51 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:34 +0000 |
| commit | 2f9dfeeb11db8db83da28dcc6edd099285b732a3 (patch) | |
| tree | d5a1ad70a2b156835892865ffda69105a61fcfa6 | |
| parent | 92710dcd0ee32a6025bba78d017a5edcff6ef9b9 (diff) | |
| download | poky-2f9dfeeb11db8db83da28dcc6edd099285b732a3.tar.gz | |
bitbake: fetch2: gitsm: remove duplicate code
Remove the duplicate append of the nobranch parameter from the loops and
move duplicate append of the bareclone parameter from the loops to the
URL creation.
(Bitbake rev: 75b6d0e6c3352f25a0712e6c2559120b6c3bd3bd)
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 497661bd6e..953a1ca39d 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
| @@ -124,6 +124,7 @@ class GitSM(Git): | |||
| 124 | url += ";nobranch=1" | 124 | url += ";nobranch=1" |
| 125 | url += ";lfs=%s" % ("1" if self._need_lfs(ud) else "0") | 125 | url += ";lfs=%s" % ("1" if self._need_lfs(ud) else "0") |
| 126 | url += ";rev=%s" % subrevision[module] | 126 | url += ";rev=%s" % subrevision[module] |
| 127 | url += ";bareclone=1" | ||
| 127 | # Note that adding "user=" here to give credentials to the | 128 | # Note that adding "user=" here to give credentials to the |
| 128 | # submodule is not supported. Since using SRC_URI to give git:// | 129 | # submodule is not supported. Since using SRC_URI to give git:// |
| 129 | # URL a password is not supported, one have to use one of the | 130 | # URL a password is not supported, one have to use one of the |
| @@ -157,8 +158,6 @@ class GitSM(Git): | |||
| 157 | 158 | ||
| 158 | need_update_list = [] | 159 | need_update_list = [] |
| 159 | def need_update_submodule(ud, url, module, modpath, workdir, d): | 160 | def need_update_submodule(ud, url, module, modpath, workdir, d): |
| 160 | url += ";bareclone=1;nobranch=1" | ||
| 161 | |||
| 162 | try: | 161 | try: |
| 163 | newfetch = Fetch([url], d, cache=False) | 162 | newfetch = Fetch([url], d, cache=False) |
| 164 | new_ud = newfetch.ud[url] | 163 | new_ud = newfetch.ud[url] |
| @@ -178,8 +177,6 @@ class GitSM(Git): | |||
| 178 | 177 | ||
| 179 | def download(self, ud, d): | 178 | def download(self, ud, d): |
| 180 | def download_submodule(ud, url, module, modpath, workdir, d): | 179 | def download_submodule(ud, url, module, modpath, workdir, d): |
| 181 | url += ";bareclone=1;nobranch=1" | ||
| 182 | |||
| 183 | # Is the following still needed? | 180 | # Is the following still needed? |
| 184 | #url += ";nocheckout=1" | 181 | #url += ";nocheckout=1" |
| 185 | 182 | ||
| @@ -197,8 +194,6 @@ class GitSM(Git): | |||
| 197 | subdestdir = self.destdir(ud, destdir, d) | 194 | subdestdir = self.destdir(ud, destdir, d) |
| 198 | 195 | ||
| 199 | def unpack_submodules(ud, url, module, modpath, workdir, d): | 196 | def unpack_submodules(ud, url, module, modpath, workdir, d): |
| 200 | url += ";bareclone=1;nobranch=1" | ||
| 201 | |||
| 202 | # Figure out where we clone over the bare submodules... | 197 | # Figure out where we clone over the bare submodules... |
| 203 | if ud.bareclone: | 198 | if ud.bareclone: |
| 204 | repo_conf = '' | 199 | repo_conf = '' |
| @@ -239,7 +234,6 @@ class GitSM(Git): | |||
| 239 | runfetchcmd("%s%s submodule update --recursive --no-fetch" % (cmdprefix, ud.basecmd), d, quiet=True, workdir=subdestdir) | 234 | runfetchcmd("%s%s submodule update --recursive --no-fetch" % (cmdprefix, ud.basecmd), d, quiet=True, workdir=subdestdir) |
| 240 | def clean(self, ud, d): | 235 | def clean(self, ud, d): |
| 241 | def clean_submodule(ud, url, module, modpath, workdir, d): | 236 | def clean_submodule(ud, url, module, modpath, workdir, d): |
| 242 | url += ";bareclone=1;nobranch=1" | ||
| 243 | try: | 237 | try: |
| 244 | newfetch = Fetch([url], d, cache=False) | 238 | newfetch = Fetch([url], d, cache=False) |
| 245 | newfetch.clean() | 239 | newfetch.clean() |
| @@ -256,7 +250,6 @@ class GitSM(Git): | |||
| 256 | 250 | ||
| 257 | urldata = [] | 251 | urldata = [] |
| 258 | def add_submodule(ud, url, module, modpath, workdir, d): | 252 | def add_submodule(ud, url, module, modpath, workdir, d): |
| 259 | url += ";bareclone=1;nobranch=1" | ||
| 260 | newfetch = Fetch([url], d, cache=False) | 253 | newfetch = Fetch([url], d, cache=False) |
| 261 | urldata.extend(newfetch.expanded_urldata()) | 254 | urldata.extend(newfetch.expanded_urldata()) |
| 262 | 255 | ||
