diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index e6f59413c4..6c61ff9ae8 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -1154,8 +1154,10 @@ async fn delete_git_sync_repository( ) -> Result { require_admin(is_admin, &username)?; - // Validate the resource path format - validate_git_repo_resource_path(&request.git_repo_resource_path)?; + // For deletion, only validate that path is not empty to allow cleanup of malformed entries + if request.git_repo_resource_path.is_empty() { + return Err(Error::BadRequest("Resource path cannot be empty".to_string())); + } let mut tx = db.begin().await?; diff --git a/frontend/src/lib/components/git_sync/GitSyncContext.svelte.ts b/frontend/src/lib/components/git_sync/GitSyncContext.svelte.ts index 16b313b0e6..121bbad81b 100644 --- a/frontend/src/lib/components/git_sync/GitSyncContext.svelte.ts +++ b/frontend/src/lib/components/git_sync/GitSyncContext.svelte.ts @@ -192,7 +192,7 @@ export function createGitSyncContext(workspace: string) { ) // Only call backend API if repository exists in the saved state - if (existsInInitialState && repo.git_repo_resource_path) { + if (existsInInitialState) { await WorkspaceService.deleteGitSyncRepository({ workspace, requestBody: {