Skip to content

Commit 57019fe

Browse files
committed
add url template support for bitbucket cloud
1 parent cf45639 commit 57019fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gitindex/index.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ func setTemplates(repo *zoekt.Repository, u *url.URL, typ string) error {
143143
repo.CommitURLTemplate = urlJoinPath("commits", varVersion)
144144
repo.FileURLTemplate = urlJoinPath(varPath) + "?at={{.Version}}"
145145
repo.LineFragmentTemplate = "#{{.LineNumber}}"
146+
case "bitbucket-cloud":
147+
// https://bitbucket.org/<workspace>/<repo>/commits/<version>
148+
// https://bitbucket.org/<workspace>/<repo>/src/<version>/<path>
149+
repo.CommitURLTemplate = urlJoinPath("commits", varVersion)
150+
repo.FileURLTemplate = urlJoinPath("src", varVersion, varPath)
151+
repo.LineFragmentTemplate = "#{{.LineNumber}}"
146152
case "gitlab":
147153
// https://gitlab.com/gitlab-org/omnibus-gitlab/-/commit/b152c864303dae0e55377a1e2c53c9592380ffed
148154
// https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/aad04155b3f6fc50ede88aedaee7fc624d481149/files/gitlab-config-template/gitlab.rb.template

0 commit comments

Comments
 (0)