#5410 cannot set default branch on empty project
Opened 7 months ago by bmwiedemann. Modified 7 months ago

I am using /api/0/new followed by

curl $verbose \
     --header "Authorization: token $apitoken" --request POST \
     --data "branch_name=master" \
     https://code.opensuse.org/api/0/$namespace/$pkg/git/branches

which fails to set the default branch with such a backtrace:

remote: Traceback (most recent call last):
remote:   File "/usr/lib/python3.6/site-packages/pagure/hooks/__init__.py", line 392, in run_project_hooks
remote:     changes=changes,
remote:   File "/usr/lib/python3.6/site-packages/pagure/hooks/__init__.py", line 111, in runhook
remote:     changes=changes,
remote:   File "/usr/lib/python3.6/site-packages/pagure/hooks/default.py", line 449, in post_receive
remote:     username,
remote:   File "/usr/lib/python3.6/site-packages/pagure/hooks/default.py", line 251, in inform_pull_request_urls
remote:     and refname != default_branch
remote: UnboundLocalError: local variable 'default_branch' referenced before assignment

Login to comment on this ticket.

Metadata