1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-04 00:28:36 +00:00

Fix submodule parsing when the gitmodules is missing (#35109) (#35118)

Backport #35109

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-07-18 20:22:18 +08:00
committed by GitHub
parent 315f197790
commit 693d26914f
6 changed files with 28 additions and 9 deletions

View File

@@ -129,7 +129,14 @@ func TestEntries_GetCommitsInfo(t *testing.T) {
require.NoError(t, err)
cisf, err := getCommitInfoSubmoduleFile("/any/repo-link", tree, commit, "")
require.NoError(t, err)
assert.Nil(t, cisf)
assert.Equal(t, &CommitSubmoduleFile{
repoLink: "/any/repo-link",
fullPath: "file1.txt",
refURL: "",
refID: "e2129701f1a4d54dc44f03c93bca0a2aec7c5449",
}, cisf)
// since there is no refURL, it means that the submodule info doesn't exist, so it won't have a web link
assert.Nil(t, cisf.SubmoduleWebLinkTree(t.Context()))
})
}