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

Make GitLab path uniqueness case-insensitive #557

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/557.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Forbid creating multiple GitLab connections on the same path with different letter casing.
2 changes: 1 addition & 1 deletion src/Connections/GitlabRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class GitLabRepoConnection extends CommandConnection<GitLabRepoConnection
const stateEventKey = `${validData.instance}/${validData.path}`;
const connection = new GitLabRepoConnection(roomId, stateEventKey, as, validData, tokenStore, instance);
const existingConnections = getAllConnectionsOfType(GitLabRepoConnection);
const existing = existingConnections.find(c => c.roomId === roomId && c.stateKey === connection.stateKey);
const existing = existingConnections.find(c => c.roomId === roomId && c.path === connection.path);

if (existing) {
throw new ApiError("A GitLab repo connection for this project already exists", ErrCode.ConflictingConnection, -1, {
Expand Down