Fetch when already cloned in nix build script

This commit is contained in:
Thomas Krijnen
2024-12-04 09:18:39 +01:00
parent 07cf701e90
commit 243e974866
+1
View File
@@ -350,6 +350,7 @@ def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
run([git, "clone", "--recursive", clone_url, target_dir])
else:
logger.info(f"directory '{target_dir}' already cloned. Pulling latest changes.")
run([git, "-C", target_dir, "fetch", "--all", "--tags"])
# detect whether we are on a branch and pull
if run([git, "rev-parse", "--abbrev-ref", "HEAD"], cwd=target_dir) != "HEAD":