# Check if additional git provider is not the original git provider \(\#26533\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/910531bc333b38eff37c3770f519742de2ee33fe)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 910531bc333b38eff37c3770f519742de2ee33fe

Requested commit: 910531bc333b38eff37c3770f519742de2ee33fe

Commit: 910531bc333b38eff37c3770f519742de2ee33fe

Tree: 5e82974f10ff6129222e3236543fb44296bb618b

Author: Nils Koch

Committer: GitHub

## Message

```
Check if additional git provider is not the original git provider (#26533)

Release Notes:

- N/A

Yesterday I worked on https://github.com/zed-industries/zed/pull/26482
and noticed afterwards that we have duplicated hosting providers if the
git remote host is "gitlab.com" and after the PR also for "github.com".
This is not a big problem, since the original providers are registered
first and therefore we first find a match with the original providers,
but I think we should address this nevertheless.

We initialize every hosting provider with the defaults here:

https://github.com/zed-industries/zed/blob/b008b2863ee015a9dc6ecdcd6dedbc708983f8b3/crates/git_hosting_providers/src/git_hosting_providers.rs#L15-L24

After that, we also register additional hosting providers:

https://github.com/zed-industries/zed/blob/b008b2863ee015a9dc6ecdcd6dedbc708983f8b3/crates/git_hosting_providers/src/git_hosting_providers.rs#L30-L43

If we do not check if the additional provider is not the original
provider, we will register the same provider twice.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
```

## Parents

- [690f26cf8b0265fe7fe54566b20f1afe3946187b](https://git.cafe/gitcafe/zed/commit/690f26cf8b0265fe7fe54566b20f1afe3946187b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/910531bc333b38eff37c3770f519742de2ee33fe?format=markdown)
