Skip to content

add branch to challenges#197

Open
MilyMilo wants to merge 4 commits intoCTFd:masterfrom
MilyMilo:milymilo/add-branch-to-challenges
Open

add branch to challenges#197
MilyMilo wants to merge 4 commits intoCTFd:masterfrom
MilyMilo:milymilo/add-branch-to-challenges

Conversation

@MilyMilo
Copy link
Contributor

@MilyMilo MilyMilo commented Feb 5, 2026

Currently we only support operating on arbitrary branches when using the subrepo module, however there's no reason why this should not be available for subtree as well.

This pull replaces get_git_repo_head_branch with a more generic resolve_repo_url which parses the repository including (optionally) a provided branch.

Also fixed a deadlock logic with ctf challenge push - essentially pushing all challenges would've never worked since we were making a commit including only the challenge path, which would always fail to push a subtree since the working directory was not clean. alternatively, committing the changes would not have pushed them, since we were looking for uncommitted changes.

I don't believe pushing uncommitted changes is a right call, the cli should not implicitly just push uncommitted code. The changed implementation pushes the commits that are new, and expects changes to be committed. Also removed automatic pull since it is not required and only pollutes the git log.

fyi this can be easily tested with uv tool:

uv tool install ctfcli --from git+https://github.com/MilyMilo/ctfcli.git@milymilo/add-branch-to-challenges

@MilyMilo MilyMilo force-pushed the milymilo/add-branch-to-challenges branch from 8a64efd to 3a7bef1 Compare February 6, 2026 13:54
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

Successfully merging this pull request may close these issues.

1 participant