From de09f3ece2344ff781259c705408ccbfd63d379e Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 27 Jan 2024 20:08:05 -0500 Subject: [PATCH] Allow existing '/refs' in SourceHut URLs (#1347) --- lib/app_sources/sourcehut.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/app_sources/sourcehut.dart b/lib/app_sources/sourcehut.dart index 0c691c4..e28294c 100644 --- a/lib/app_sources/sourcehut.dart +++ b/lib/app_sources/sourcehut.dart @@ -39,6 +39,15 @@ class SourceHut extends AppSource { String standardUrl, Map additionalSettings, ) async { + if (standardUrl.endsWith('/refs')) { + standardUrl = standardUrl + .split('/') + .reversed + .toList() + .sublist(1) + .reversed + .join('/'); + } Uri standardUri = Uri.parse(standardUrl); String appName = standardUri.pathSegments.last; bool fallbackToOlderReleases =