diff mbox series

[3/4] bitbake-layers: layerindex-fetch: Respect --branch for already-configured layers

Message ID 20251212190806.32476-4-osama.abdelkader@gmail.com
State New
Headers show
Series bitbake-layers: layerindex-fetch: respect --branch for already-configured layers | expand

Commit Message

Osama Abdelkader Dec. 12, 2025, 7:08 p.m. UTC
When --branch is specified, prevent the early exit that skips branch
verification. This ensures that even if a layer is already in bblayers.conf,
the command will still check and switch to the requested branch if needed.

This fixes the issue where the command would exit early with "You already
have the requested layer(s)" without verifying the branch.

[YOCTO #7852]

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 lib/bblayers/layerindex.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
index 1c6511889d..e0df630a7f 100644
--- a/lib/bblayers/layerindex.py
+++ b/lib/bblayers/layerindex.py
@@ -120,7 +120,8 @@  class LayerIndexPlugin(ActionPlugin):
 
         # Fast path, check if we already have what has been requested!
         (dependencies, invalidnames) = cookerIndex.find_dependencies(names=args.layername, ignores=ignore_layers)
-        if not args.show_only and not invalidnames:
+        if not args.show_only and not invalidnames and not args.branch:
+            # Only skip if no specific branch was requested
             logger.plain("You already have the requested layer(s): %s" % args.layername)
             return 0