Skip to content

Conversation

@jakub-nt
Copy link
Contributor

No description provided.

This function could be used not just for commits but also for branches or tags, and so the current name is not precisely correct

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
The comment is outdated after b451f92

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…s commands

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
@jakub-nt jakub-nt requested a review from larsewi October 31, 2025 14:07
repo_url, commit = repo_url.rsplit("@", 1)
if not is_a_commit_hash(commit):
raise CFBSExitError("'%s' is not a commit reference" % commit)
assert "@" not in repo_url or (repo_url.rindex("@") < repo_url.rindex("."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, and probably done this way in other places, but to me, using an if looks more readable (close to how I would explain it) rather than the "or" way;

if "@" in repo_url:
  assert repo_url.rindex("@") < repo_url.rindex(".")

@olehermanse olehermanse merged commit 5c5046a into cfengine:master Oct 31, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants