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

The git importer is missing import subprocess which causes grade clone ... -d <date> to fail. #1

Open
maemre opened this issue Sep 8, 2022 · 1 comment

Comments

@maemre
Copy link

maemre commented Sep 8, 2022

The git importer (the actions.git module) uses the subprocess module to do piping to get the default branch but it does not import this module, just importing submodule fixes this problem. This path is triggered only when a deadline is given with the -d command line option (so, the importer works fine without a deadline, and it might have gone unnoticed).

@maemre
Copy link
Author

maemre commented Sep 8, 2022

Another solution would be to use cmd_exec_capture and process the output using string.split rather than piping it to cut, something along the lines of:

head_branch_line = cmd_exec_capture(['git', 'branch', '--remotes', '--list', '*/HEAD'], wd=local)
# the command above outputs a line like "origin/HEAD -> origin/<main branch>\n", here we extract <main branch>
return head_branch_line.split('/')[2].strip()

@phpeterson-usf if you don't have the bandwidth for this, I can implement this, test it then make a PR.

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

1 participant