From 8fd6a67cbc751748a3586bbb25d2c1234aff2e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Sun, 14 May 2023 23:10:11 +0300 Subject: [PATCH 1/1] Worker: Configure bare Git repository for subsequent fetching Must be done or the refs are not updated when fetching. --- worker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.py b/worker.py index 3a943bb..444bcb0 100644 --- a/worker.py +++ b/worker.py @@ -179,9 +179,10 @@ class RepoFetcher (threading.Thread): if not os.path.exists(pjoin(cache_path, 'config')): git.run(['clone', '--bare', repo.clone_url, cache_path], without_path=True) + git.run(['config', 'remote.origin.fetch', 'refs/heads/*:refs/heads/*']) # enable fetch num_commits = None else: - git.run(['fetch']) + git.run(['fetch', '--prune']) num_commits = 100 # Since the last `INTERVAL` mins, so probably enough. # Update the fetch timestamp. -- 2.34.1