Gitea: Submodule link can only work at root

Created on 20 Jun 2019  路  1Comment  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): a71cabb
  • Git version: 2.22.0
  • Operating system: Windows Server 2012 R2
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [x] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [x] Yes (provide example URL)

    • [ ] No

    • [ ] Not relevant

  • Log gist:

Description

The submodule link can only work when it's added at the project root directory. If the submodule is added in a directory then Gitea will fail to generate link.

Here is the repo with the submodule added at the "subdir" directory
https://try.gitea.io/jacktseng/submodule_at_subdir

Here is another branch in the same repo but with additional submodule added at root
https://try.gitea.io/jacktseng/submodule_at_subdir/src/branch/trick

You can find in the master branch Gitea doesn't generate the link for the submodule. But in the trick branch, Gitea can generate the link for both the submodule at root and for the one at "subdir".

...

Screenshots

kinbug

Most helpful comment

The bug seems to be that it doesn't include the full path of the folder when checking to see if there is a matching entry in .gitmodules. It happens to work in the 2nd example because you've also added one at the top level and given them both the same name here, so subdir/sub_moduleRoot is actually just matching the also added path = sub_moduleRoot by coincidence since it is only searching for sub_moduleRoot.

Thank you for test case, hopefully PR should fix it.

>All comments

The bug seems to be that it doesn't include the full path of the folder when checking to see if there is a matching entry in .gitmodules. It happens to work in the 2nd example because you've also added one at the top level and given them both the same name here, so subdir/sub_moduleRoot is actually just matching the also added path = sub_moduleRoot by coincidence since it is only searching for sub_moduleRoot.

Thank you for test case, hopefully PR should fix it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorise7 picture jorise7  路  3Comments

BNolet picture BNolet  路  3Comments

thehowl picture thehowl  路  3Comments

ghost picture ghost  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments