From d4d0209623006ba964f5a8c4d5a7b32e708ee537 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Mon, 4 Jan 2021 09:10:56 +0100 Subject: [PATCH] Initial work to auto-commit updated caches --- obs/update_unstable.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/obs/update_unstable.py b/obs/update_unstable.py index 1f91643..b1fd9e3 100755 --- a/obs/update_unstable.py +++ b/obs/update_unstable.py @@ -151,6 +151,16 @@ def update_packages(cache_file, repo_mapping_file): hash_data.save() +def commit_changes(cache_file): + + repo = git.Repo(Path.curdir()) + repo.index.add([cache_file]) + repo.index.commit("Update caches") + origin = repo.remotes["origin"] + origin.pull(rebase=True) + origin.push() + + def main(): parser = argparse.ArgumentParser()