From be09c4afaf337d163d0d8db10242cdfd2c64558c Mon Sep 17 00:00:00 2001 From: notplants Date: Mon, 22 Mar 2021 11:39:15 +0100 Subject: [PATCH 1/2] Use git reset --hard for checkout --- peach_package_builder/build_peach_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peach_package_builder/build_peach_config.py b/peach_package_builder/build_peach_config.py index 36570e6..0171668 100644 --- a/peach_package_builder/build_peach_config.py +++ b/peach_package_builder/build_peach_config.py @@ -31,8 +31,8 @@ def build_peach_config(default_branch=True): cwd=service_path).decode(sys.stdout.encoding) branch = default_branch.replace('origin/', '').strip() subprocess.check_call(["git", "checkout", branch], cwd=service_path) - subprocess.check_call(["git", "reset", "HEAD", "--hard"], cwd=service_path) - subprocess.check_call(["git", "pull"], cwd=service_path) + subprocess.check_call(["git", "fetch", "--all"], cwd=service_path) + subprocess.check_call(["git", "reset", "--hard", default_branch], cwd=service_path) # remove old build dir subprocess.check_call([ "rm", From e96bfe9777c7535e3ef3291f14ba7cc0f0b68ae1 Mon Sep 17 00:00:00 2001 From: notplants Date: Mon, 22 Mar 2021 11:41:15 +0100 Subject: [PATCH 2/2] Also add change for rust --- peach_package_builder/build_rust_packages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peach_package_builder/build_rust_packages.py b/peach_package_builder/build_rust_packages.py index 68a821c..9219396 100644 --- a/peach_package_builder/build_rust_packages.py +++ b/peach_package_builder/build_rust_packages.py @@ -36,8 +36,8 @@ def build_rust_packages(default_branch=False): cwd=service_path).decode(sys.stdout.encoding) branch = default_branch.replace('origin/', '').strip() subprocess.check_call(["git", "checkout", branch], cwd=service_path) - subprocess.check_call(["git", "reset", "HEAD", "--hard"], cwd=service_path) - subprocess.check_call(["git", "pull"], cwd=service_path) + subprocess.check_call(["git", "fetch", "--all"], cwd=service_path) + subprocess.check_call(["git", "reset", "--hard", default_branch], cwd=service_path) debian_package_path = subprocess.check_output( [ CARGO_PATH,