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

Can't add collaborator to empty repo #464

Closed
4erf opened this issue Jan 23, 2024 · 0 comments · Fixed by #466
Closed

Can't add collaborator to empty repo #464

4erf opened this issue Jan 23, 2024 · 0 comments · Fixed by #466
Labels
bug Something isn't working

Comments

@4erf
Copy link

4erf commented Jan 23, 2024

When trying to add a collaborator to a recently created repo it gives the following message:

Error: reference does not exist

When trying again the following message appears:

Error: duplicate key value violates table constraint

If I try to delete the collaborator I get the first error. If I try to add again I still get second error.

To Reproduce

  1. Start with admin ssh key
  2. Create first user ssh -p 23231 localhost user create beatrice
  3. Create second user ssh -p 23231 localhost user create frankie
  4. Switch to beatrice key
  5. Create new repo for beatrice ssh -p 23231 localhost repo create icecream
  6. Add frankie as collaborator ssh -p 23231 localhost repo collab add icecream frankie
  7. See error

Environment (please complete the following information):

  • Docker image 0.7.4

Additional info

Doing repo collab list shows the new collaborator.

I managed to find a workaround, which is adding a initial commit first, then adding the collaborator. Not ideal in this case as I want the owner of the repo to be user1 but because the repo is in the server of user2 I need to add it as collaborator so that user2 can do the initial commit. However, workaround forces user2 to be owner of repo, adding user1 as collab after, or doing dummy commit from user1.

@aymanbagabas aymanbagabas added the bug Something isn't working label Jan 29, 2024
aymanbagabas added a commit that referenced this issue Jan 29, 2024
Propagate a more informative error when adding an existing collaborator.
Ignore webhooks default branch git reference not found errors because
the repo won't have a default branch when it's empty.

Fixes: #464
aymanbagabas added a commit that referenced this issue Jan 30, 2024
Propagate a more informative error when adding an existing collaborator.
Ignore webhooks default branch git reference not found errors because
the repo won't have a default branch when it's empty.

Fixes: #464
aymanbagabas added a commit that referenced this issue Feb 5, 2024
Propagate a more informative error when adding an existing collaborator.
Ignore webhooks default branch git reference not found errors because
the repo won't have a default branch when it's empty.

Fixes: #464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants