From 0bc707ad3482844000ec2de86f02c5e5ae862514 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Thu, 30 Oct 2025 08:58:39 -0500 Subject: [PATCH] CI: Silence expected error message for shallow repo --- src/Tools/SubWCRev.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tools/SubWCRev.py b/src/Tools/SubWCRev.py index 3e75e8efee..45088371fb 100644 --- a/src/Tools/SubWCRev.py +++ b/src/Tools/SubWCRev.py @@ -305,7 +305,8 @@ class GitControl(VersionControl): referencerevision = 14555 result = None - countallfh = os.popen("git rev-list --count %s..HEAD" % referencecommit) + null_device = "nul" if os.name == "nt" else "/dev/null" + countallfh = os.popen(f"git rev-list --count {referencecommit}..HEAD 2>{null_device}") countallstr = countallfh.read().strip() if countallfh.close() is not None: # reference commit not present, use the date date_object = datetime.datetime.strptime(self.date, "%Y/%m/%d %H:%M:%S")