From 2f9dfeeb11db8db83da28dcc6edd099285b732a3 Mon Sep 17 00:00:00 2001 From: Stefan Herbrechtsmeier Date: Fri, 5 Sep 2025 08:20:51 +0200 Subject: 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 9 +-------- 1 file changed, 1 insertion(+), 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): url += ";nobranch=1" url += ";lfs=%s" % ("1" if self._need_lfs(ud) else "0") url += ";rev=%s" % subrevision[module] + url += ";bareclone=1" # Note that adding "user=" here to give credentials to the # submodule is not supported. Since using SRC_URI to give git:// # URL a password is not supported, one have to use one of the @@ -157,8 +158,6 @@ class GitSM(Git): need_update_list = [] def need_update_submodule(ud, url, module, modpath, workdir, d): - url += ";bareclone=1;nobranch=1" - try: newfetch = Fetch([url], d, cache=False) new_ud = newfetch.ud[url] @@ -178,8 +177,6 @@ class GitSM(Git): def download(self, ud, d): def download_submodule(ud, url, module, modpath, workdir, d): - url += ";bareclone=1;nobranch=1" - # Is the following still needed? #url += ";nocheckout=1" @@ -197,8 +194,6 @@ class GitSM(Git): subdestdir = self.destdir(ud, destdir, d) def unpack_submodules(ud, url, module, modpath, workdir, d): - url += ";bareclone=1;nobranch=1" - # Figure out where we clone over the bare submodules... if ud.bareclone: repo_conf = '' @@ -239,7 +234,6 @@ class GitSM(Git): runfetchcmd("%s%s submodule update --recursive --no-fetch" % (cmdprefix, ud.basecmd), d, quiet=True, workdir=subdestdir) def clean(self, ud, d): def clean_submodule(ud, url, module, modpath, workdir, d): - url += ";bareclone=1;nobranch=1" try: newfetch = Fetch([url], d, cache=False) newfetch.clean() @@ -256,7 +250,6 @@ class GitSM(Git): urldata = [] def add_submodule(ud, url, module, modpath, workdir, d): - url += ";bareclone=1;nobranch=1" newfetch = Fetch([url], d, cache=False) urldata.extend(newfetch.expanded_urldata()) -- cgit v1.2.3-54-g00ecf