From eab0f2eb970a2f93e139ae11c84b25d448dd2f17 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 19 Sep 2024 11:20:12 +0530 Subject: [PATCH] fix: skip diff if hashes are the same --- agent/bench.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agent/bench.py b/agent/bench.py index 82173447..5955ce80 100644 --- a/agent/bench.py +++ b/agent/bench.py @@ -941,6 +941,11 @@ def _pull_app_change(self, app: BenchUpdateApp) -> list[str]: new_hash: str = app["hash"] old_hash: str = exec("git rev-parse HEAD")["output"] + if old_hash == new_hash: + # Remove remote, url might be private + exec(f"git remote remove {remote}") + return [] + # Fetch new hash and get changed files exec(f"git fetch --depth 1 {remote} {new_hash}") diff: str = exec(f"git diff --name-only {old_hash} {new_hash}")["output"]