Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git.py: added directory tracking to the Moulin git builder #92

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions moulin/fetchers/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ def __init__(self, conf: YamlValue, build_dir: str, generator: ninja_syntax.Writ
def gen_fetch(self):
"""Generate instruction to fetch git repo"""
clone_target = self.git_dir
clone_stamp = create_stamp_name(self.build_dir, self.url, "clone")
checkout_stamp = create_stamp_name(self.build_dir, self.url, "checkout")
clone_stamp = create_stamp_name(self.build_dir, clone_target, self.url, "clone")
checkout_stamp = create_stamp_name(self.build_dir, clone_target, self.url, "checkout")

if checkout_stamp in _SEEN_REPOS_REV:
if self.git_rev != _SEEN_REPOS_REV[checkout_stamp]:
# Fail on occurrence of different revision for the already downloaded repository
raise YAMLProcessingError(f"ERROR: Repository {self.url} has two revisions '{self.git_rev}' "
raise YAMLProcessingError(f"ERROR: Repository {self.url} cloned to '{clone_target}' "
f"has two revisions '{self.git_rev}' "
f"and '{_SEEN_REPOS_REV[checkout_stamp]}'", self.conf["rev"].mark)
else:
# Do not checkout repos for the second time
Expand Down