From: Alexandre Belloni <[email protected]>

Ensure we fetch the tag before listing the first commit.

[ YOCTO #15193 ]

Signed-off-by: Alexandre Belloni <[email protected]>
---
 scripts/yocto_testresults_query.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/yocto_testresults_query.py 
b/scripts/yocto_testresults_query.py
index a5073736aab5..cc591177bb2a 100755
--- a/scripts/yocto_testresults_query.py
+++ b/scripts/yocto_testresults_query.py
@@ -31,7 +31,8 @@ def create_workdir():
 
 def get_sha1(pokydir, revision):
     try:
-        rev = subprocess.check_output(["git", "rev-list", "-n", "1", 
revision], cwd=pokydir).decode('utf-8').strip()
+        subprocess.check_call(["git", "fetch", "--depth", "1", "origin", 
revision], cwd=pokydir)
+        rev = subprocess.check_output(["git", "rev-list", "-n", "1", 
"FETCH_HEAD"], cwd=pokydir).decode('utf-8').strip()
         logger.info(f"SHA-1 revision for {revision} in {pokydir} is {rev}")
         return rev
     except subprocess.CalledProcessError:
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#187547): 
https://lists.openembedded.org/g/openembedded-core/message/187547
Mute This Topic: https://lists.openembedded.org/mt/101324435/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to