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

[FIX] Allow pinning commits in repos.yaml #5

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions odoo_filter_addons/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,16 @@ def filter_repo(agg_path, rname, repo, modules):
# Create a message that will allow tracing the commit
lines = [rname]
for merge in repo["merges"]:
if "merge-requests" in merge or "pull" in merge:
last_hash = git("-C", rpath, "ls-remote", "--exit-code", *merge.split()).split()[0]
merge = merge.strip()
remote, ref = merge.split()
if ref.startswith("refs/"):
commit = git("-C", rpath, "ls-remote", "--exit-code", remote, ref).split()[0]
lines.append(f"{merge} {commit}")
elif len(ref) == 40:
lines.append(merge)
else:
last_hash = git("-C", rpath, "rev-parse", merge.replace(" ", "/"))
lines.append(f"{merge} {last_hash}".strip())
commit = git("-C", rpath, "rev-parse", merge.replace(" ", "/"))
lines.append(f"{merge} {commit}")
message = "\n".join(lines)
print(f"Partial message:\n{message}")
return message
Expand Down
2 changes: 1 addition & 1 deletion odoo_filter_addons/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.0"
__version__ = "1.3.1"
Loading