From 97f2b96328e33f6902106b3808263a00f24e6444 Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 11 Jan 2022 15:38:34 +0100 Subject: [PATCH] update build.rs --- zokrates_core/build.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zokrates_core/build.rs b/zokrates_core/build.rs index eac791b4f..1dc61fb35 100644 --- a/zokrates_core/build.rs +++ b/zokrates_core/build.rs @@ -26,10 +26,13 @@ fn main() { }); let commit = Oid::from_str(LIBSNARK_COMMIT).unwrap(); - let commit = repo.find_commit(commit).unwrap(); + let head = repo.head().unwrap(); - repo.reset(&commit.as_object(), ResetType::Hard, None) - .unwrap(); + if commit.ne(&head.target().unwrap()) { + let commit = repo.find_commit(commit).unwrap(); + repo.reset(&commit.as_object(), ResetType::Hard, None) + .unwrap(); + } for mut s in repo.submodules().unwrap() { s.update(true, None).unwrap();