-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Here's a site running gitea: https://zxq.co/ripple/hanayo/routers/oauth?go-get=1. It says:
<meta name="go-import" content="zxq.co/ripple/hanayo/routers/oauth git https://zxq.co/ripple/hanayo.git">
The general form of this tag is
<meta name="go-import" content="IMPORT VCS REPO">
which says that the code at the root directory of VCS REPO is what to use for IMPORT. The tag above is incorrect because it says that https://zxq.co/ripple/hanayo.git is what to use for zxq.co/ripple/hanayo/routers/oauth, but in fact it's what to use for zxq.co/ripple/hanayo.
The correct tag is:
<meta name="go-import" content="zxq.co/ripple/hanayo git https://zxq.co/ripple/hanayo.git">
That is, even though we asked about zxq.co/ripple/hanayo/routers/oauth, the meta tag should tell about the root of the git repo not the current subdirectory (the subdirectory will be deduced from the root).
This happens because routers/repo/http.go includes the subdir in:
func composeGoGetImport(owner, repo, sub string) string {
return path.Join(setting.Domain, setting.AppSubURL, owner, repo, sub)
}
I believe it would fix this problem to simply drop the ", sub" from the call.