diff mbox series

[yocto-autobuilder-helper] scripts/getproperties: Fix to handled detached head states

Message ID 20251127164026.853181-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [yocto-autobuilder-helper] scripts/getproperties: Fix to handled detached head states | expand

Commit Message

Richard Purdie Nov. 27, 2025, 4:40 p.m. UTC
Now that we have a whinlatter branch, we're seeing HEAD being reported instead
of the real branch name. For some reason buildbot leaves the tree in a detached
head state even though the revisions match and this doesn't work with rev-parse.

Try using name-rev instead (thanks Mathieu for the pointer).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/getproperties.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/getproperties.py b/scripts/getproperties.py
index 5c342c7..a0175c2 100755
--- a/scripts/getproperties.py
+++ b/scripts/getproperties.py
@@ -21,7 +21,7 @@  def get_revision(repopath):
     return subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=repopath).decode('utf-8').strip()
 
 def get_branch(repopath):
-   return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=repopath).decode('utf-8').strip()
+   return subprocess.check_output(["git", "name-rev", "--name-only", "HEAD"], cwd=repopath).decode('utf-8').strip()
 
 jsonprops = {}
 jsonprops['commit_yocto-autobuilder-helper'] = get_revision(builddir + "/../yocto-autobuilder-helper/")