ci: handle changing wrap file refs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7821>
This commit is contained in:
Matthew Waters 2024-11-04 15:52:11 +11:00 committed by GStreamer Marge Bot
parent ce35c07639
commit 76a037d29a

View file

@ -68,6 +68,15 @@ def copy_cache(options):
print("Copying from %s -> %s" % (cache_dir, project_path)) print("Copying from %s -> %s" % (cache_dir, project_path))
shutil.copytree(cache_dir, project_path) shutil.copytree(cache_dir, project_path)
# workaround `meson subprojects download` only providing a shallow
# clone.
# If we need to change refs, then the git repo will only ever be
# able to reference the originally cloned ref.
git_path = os.path.join(project_path, '.git')
if os.path.exists(git_path):
subprocess.check_call(['git', '-C', git_path, 'remote', 'set-branches', 'origin', '*'])
subprocess.check_call(['meson', 'subprojects', 'update', '--reset']) subprocess.check_call(['meson', 'subprojects', 'update', '--reset'])