From c93f568ff754d4904022f8f2d03ea4106df6ca3e Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sat, 04 Apr 2026 03:10:22 +0000 Subject: [PATCH] appview/reporesolver: remove unused regex and function Signed-off-by: oppiliappan --- appview/reporesolver/resolver.go | 23 ++--------------------- 1 file(s) changed, 2 insertion(s)(+), 21 deletion(s)(-) diff --git a/appview/reporesolver/resolver.go b/appview/reporesolver/resolver.go --- a/appview/reporesolver/resolver.go +++ b/appview/reporesolver/resolver.go @@ -19,9 +19,8 @@ ) var ( - blobPattern = regexp.MustCompile(`blob/[^/]+/(.*)$`) - treePattern = regexp.MustCompile(`tree/[^/]+/(.*)$`) - pathAfterRefRE = regexp.MustCompile(`(?:blob|tree|raw)/[^/]+/(.*)$`) + blobPattern = regexp.MustCompile(`blob/[^/]+/(.*)$`) + treePattern = regexp.MustCompile(`tree/[^/]+/(.*)$`) ) type RepoResolver struct { @@ -166,22 +165,4 @@ } return "." -} - -// extractPathAfterRef gets the actual repository path -// after the ref. for example: -// -// /@icyphox.sh/foorepo/blob/main/abc/xyz/ => abc/xyz/ -func extractPathAfterRef(fullPath string) string { - fullPath = strings.TrimPrefix(fullPath, "/") - - // pathAfterRefRE matches blob/, tree/, or raw/ followed by any ref and then a slash; - // it captures everything after the final slash. - matches := pathAfterRefRE.FindStringSubmatch(fullPath) - - if len(matches) > 1 { - return matches[1] - } - - return "" } -- tangled.sh