charmbracelet / soft-serve

The mighty, self-hostable Git server for the command linešŸ¦
MIT License
5.33k stars 135 forks source link

Can't add collaborator to empty repo #464

Closed 4erf closed 8 months ago

4erf commented 9 months ago

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):

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.