MCPcopy Index your code
hub / github.com/apache/devlake / getRepoNamespaceFromUrlPath

Function getRepoNamespaceFromUrlPath

backend/plugins/tapd/tasks/shared.go:363–369  ·  view source on GitHub ↗

getRepoNamespaceFromUrlPath returns the namespace of a repository from the given URL path, which is the url path without the last segment, and without leading and trailing slashes.

(path string)

Source from the content-addressed store, hash-verified

361// returns the namespace of a repository from the given URL path,
362// which is the url path without the last segment, and without leading and trailing slashes.
363func getRepoNamespaceFromUrlPath(path string) string {
364 // Remove leading and trailing slashes
365 path = strings.Trim(path, "/")
366 // Remove last segment
367 path = path[:strings.LastIndex(path, "/")]
368 return path
369}
370
371// getRepoNameFromUrlPath
372// returns the last segment of url path as repo name, without .git suffix.

Callers 3

ConvertTaskCommitFunction · 0.85
ConvertStoryCommitFunction · 0.85
ConvertBugCommitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected