Closed
Description
Bug description
#185 adds autodetecting branch name on omission. But now we have two consecutive optional args on the commandline - branch and repo_dir (target clone path). So if we want to pass just the repo url and repo_dir, it's currently not possible.
Expected behaviour
Tell nbgitpuller to autodetect branch name but specify target directory when called from the commandline
Actual behaviour
If only two arguments are specified on the commandline, they are counted as repo url and branch, not repo url and repo_dir
How to reproduce
❯ gitpuller https://github.com/jupyterhub/jupyterhub target-dir 2 ↵
Traceback (most recent call last):
File "/Users/yuvipanda/.local/share/virtualenvs/nbgitpuller/bin/gitpuller", line 33, in <module>
sys.exit(load_entry_point('nbgitpuller', 'console_scripts', 'gitpuller')())
File "/Users/yuvipanda/code/nbgitpuller/nbgitpuller/pull.py", line 310, in main
for line in GitPuller(
File "/Users/yuvipanda/code/nbgitpuller/nbgitpuller/pull.py", line 78, in __init__
raise ValueError(f"Branch: {self.branch_name} -- not found in repo: {self.git_url}")
ValueError: Branch: target-dir -- not found in repo: https://github.com/jupyterhub/jupyterhub