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

check50 can't find checks if another branch is a prefix of the check branch #241

Open
bjorn-out opened this issue Jan 3, 2021 · 2 comments

Comments

@bjorn-out
Copy link

We're trying to run checks in a branch called 2020_checks, like so:

check50 -l bjorn-out/webprogrammeren/2020_checks/movies

However, a branch 2020 also exists and check50 attempts to grab a check from that branch instead. This fails, as no such check is available in that branch.

~/workspace/movies/ $ check50 -l --log-level DEBUG bjorn-out/webprogrammeren/2020_checks/movies
Checking...
(DEBUG) 33eb80d0176adf2e9a8cc3d1c777162b0883579f        refs/heads/2019
c113c842ce6e0e2a20c90bd039912506cccf5381        refs/heads/2020
f289610b5e9b22dee9925963ebacc01ab274244e        refs/heads/2020_checks
33eb80d0176adf2e9a8cc3d1c777162b0883579f        refs/heads/master
(INFO) git -C /home/ubuntu/.local/share/check50/bjorn-out/webprogrammeren fetch origin 2020

[removed downloading spam]

(DEBUG) From https://github.com/bjorn-out/webprogrammeren
 * branch            2020       -> FETCH_HEAD
(DEBUG) * [new branch]      2020       -> origin/2020
(INFO) git -C /home/ubuntu/.local/share/check50/bjorn-out/webprogrammeren checkout -f -B 2020 origin/2020
(DEBUG) Branch '2020' set up to track remote branch '2020' from 'origin'.
(DEBUG) Switched to a new branch '2020'
(INFO) git -C /home/ubuntu/.local/share/check50/bjorn-out/webprogrammeren reset --hard HEAD
(DEBUG) HEAD is now at c113c84 slugs
Could not find checks for bjorn-out/webprogrammeren/2020_checks/movies.
@tommylenz
Copy link

Interesting! Check50 actually downloads the checks because of your -l flag. This is done by lib50's local function, as you can see here.

The branch named 2020 is fetched ((INFO) git -C /home/ubuntu/.local/share/check50/bjorn-out/webprogrammeren fetch origin 2020 in your description), which corresponds to this line in lib50's code, ergo local_path = 2020. The underscore, and what's behind it, seem to get lost somewhere on track. I can't figure out where, yet.

For the time being, try renaming your branch (or creating another one) for testing out whether it works when the branch is named 2020/checks and your slug is Bjorn-out/webprogrammeren/2020/checks/movies, as per the example, or not.

@bjorn-out
Copy link
Author

We've renamed the branch to checks_2020 (in the original repo minprog/webprogrammeren) and this works fine. It seems to only happen whenever the check branch is prefixed with the name of some other branch. Very interesting indeed :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants