Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/reporesolver: remove unused regex and function

Signed-off-by: oppiliappan <me@oppi.li>

+2 -21
+2 -21
appview/reporesolver/resolver.go
··· 19 19 ) 20 20 21 21 var ( 22 - blobPattern = regexp.MustCompile(`blob/[^/]+/(.*)$`) 23 - treePattern = regexp.MustCompile(`tree/[^/]+/(.*)$`) 24 - pathAfterRefRE = regexp.MustCompile(`(?:blob|tree|raw)/[^/]+/(.*)$`) 22 + blobPattern = regexp.MustCompile(`blob/[^/]+/(.*)$`) 23 + treePattern = regexp.MustCompile(`tree/[^/]+/(.*)$`) 25 24 ) 26 25 27 26 type RepoResolver struct { ··· 167 166 168 167 return "." 169 168 } 170 - 171 - // extractPathAfterRef gets the actual repository path 172 - // after the ref. for example: 173 - // 174 - // /@icyphox.sh/foorepo/blob/main/abc/xyz/ => abc/xyz/ 175 - func extractPathAfterRef(fullPath string) string { 176 - fullPath = strings.TrimPrefix(fullPath, "/") 177 - 178 - // pathAfterRefRE matches blob/, tree/, or raw/ followed by any ref and then a slash; 179 - // it captures everything after the final slash. 180 - matches := pathAfterRefRE.FindStringSubmatch(fullPath) 181 - 182 - if len(matches) > 1 { 183 - return matches[1] 184 - } 185 - 186 - return "" 187 - }