check50 icon indicating copy to clipboard operation
check50 copied to clipboard

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

Open bjorn-out opened this issue 5 years ago • 2 comments

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.

bjorn-out avatar Jan 03 '21 16:01 bjorn-out

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.

tommylenz avatar Jan 04 '21 23:01 tommylenz

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 :-).

bjorn-out avatar Jan 04 '21 23:01 bjorn-out