Skip to content

Commit 07c64af

Browse files
committed
add template support for ado
1 parent 12a2f4a commit 07c64af

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
@@ -149,6 +149,12 @@ func setTemplates(repo *zoekt.Repository, u *url.URL, typ string) error {
149149
repo.CommitURLTemplate = urlJoinPath("commits", varVersion)
150150
repo.FileURLTemplate = urlJoinPath("src", varVersion, varPath)
151151
repo.LineFragmentTemplate = "#{{.LineNumber}}"
152+
case "azuredevops":
153+
// https://dev.azure.com/<organization>/<project>/_git/<repo>?_a=history
154+
// https://dev.azure.com/<organization>/<project>/_git/<repo>?path=/<path>&version=GB<version>
155+
repo.CommitURLTemplate = urlJoinPath() + "?_a=history&version={{.Version}}"
156+
repo.FileURLTemplate = urlJoinPath() + "?path=/{{.Path}}&version=GB{{.Version}}&_a=contents"
157+
repo.LineFragmentTemplate = "&line={{.LineNumber}}&lineEnd={{.LineNumber}}&lineStartColumn=1&lineEndColumn=200"
152158
case "gitlab":
153159
// https://gitlab.com/gitlab-org/omnibus-gitlab/-/commit/b152c864303dae0e55377a1e2c53c9592380ffed
154160
// https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/aad04155b3f6fc50ede88aedaee7fc624d481149/files/gitlab-config-template/gitlab.rb.template

0 commit comments

Comments
 (0)