diff mbox series

[2/2] bitbake-setup: correctly determine latest revision in status/update when it is fixed to a commit id

Message ID 20260305200937.221484-2-alex.kanavin@gmail.com
State New
Headers show
Series [1/2] bitbake-setup: ensure that relative local path given on 'init' command line is recorded as an absolute path | expand

Commit Message

Alexander Kanavin March 5, 2026, 8:09 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

The code was relying on git fetcher's latest_revision() method,
which works properly if the revision in the json config template
is set to a branch or a tag, but does not work if it is set to
a fixed revision (the method will return the latest revision on the
respective branch, and bitbake-setup will incorrectly determine
that the layer needs to be updated to that revision).

Add a guard to check if revision is a commit id, and skip the
check if so.

[YOCTO #16190]

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 bin/bitbake-setup | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 1a42aaa51..69362b589 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -741,9 +741,13 @@  def get_diff(file1, file2):
     return None
 
 def are_layers_changed(layers, layerdir, d):
+    from bb.fetch2.git import sha1_re
+
     def _is_git_remote_changed(r_remote, repodir):
         changed = False
         rev = r_remote['rev']
+        if sha1_re.match(rev):
+            return False
         branch = r_remote.get('branch', None)
 
         remotes = _get_remotes(r_remote)