-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
Description
This is a followup for #35033 and related to the FIXME in sources:
gitea/modules/git/commit_submodule_file.go
Lines 40 to 43 in 56eccb4
// FIXME: when handling relative path, this logic is not right. It needs to: | |
// 1. Remember the submodule's full path and its commit's repo home link | |
// 2. Resolve the relative path: targetRepoLink = path.Join(repoHomeLink, path.Dir(submoduleFullPath), refURL) | |
// Not an easy task and need to refactor related code a lot. |
When submodule uses relative repository paths, the submodule diff link in a PR is invalid, for example,
https://demo.gitea.com/gnuman/rel_submodule_test/pulls/1/files
lists the diff as:
https://demo.gitea.com/gnuman/rel_submodule_test/gnuman/foo.git/compare/1890948776e76bdb05f4b55acc6c035143d3fbce...e16d0fe2f699d9855e381a792e83ed3e7e134e52
and the submodule link is also invalid in the PR as:
https://demo.gitea.com/gnuman/rel_submodule_test/gnuman/foo.git
Gitea Version
main
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
demo.gitea.com
Database
None