Two accounts can have the same public key but when you go to push as with the key the first account in the database is always used. This means it is possible to create a repository which you can not push to. My suggested fix is check if a public key is already in use before adding it and tell the user accordingly. That should prevent it from ever happening.