* Fix a runtime error when modifying a repository through API call
Using the `PATCH /repos/{owner}/{repo}` endpoint and attempting to
modify `default_branch` on an empty repository will cause a
panic. This commit adds a check for a nil pointer before attempting
to dereference it.
* Apply suggestions from code review
* Apply suggestions from code review
* Ensure that the git repository is loaded
If you change the default branch for a repository you must change it in
git too. Therefore you must open the repository before changing the
default branch.
Signed-off-by: Andrew Thornton <[email protected]>
* Allow empty repos to have their default branches changed
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Anton Khimich <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Andrew Thornton <[email protected]>