diff --git a/AGENTS.md b/AGENTS.md index cf976f4e2..7a5faefb1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,7 @@ ## Core principles -- When you see changes made outside your knowledge, use the current version as your new starting point. Do not blindly overwrite those changes or you suck. Even if you have to update the code, always respect the god damn pattern in the surrounding context! +- When you see changes made outside your knowledge, use the current version as your new starting point. Do not blindly overwrite those changes or you suck. Even if you have to update the code, always respect the pattern in the surrounding context! +- Do not tell me I am right, do it right on your first try, fact-check and review after changes. If you are not sure, ask for help. ## Style and mechanics diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f190fd98..073d7199d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to Gogs are documented in this file. - Submodules using `ssh://` protocol and a port number are not rendered correctly. [#4941](https://github.com/gogs/gogs/issues/4941) - Missing link to user profile on the first commit in commits history page. [#7404](https://github.com/gogs/gogs/issues/7404) +- Unable to delete or display files with special characters in their names. [#7596](https://github.com/gogs/gogs/issues/7596) ## 0.13.4 diff --git a/go.mod b/go.mod index 1688d0190..187ed049a 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/go-macaron/toolbox v0.0.0-20190813233741-94defb8383c6 github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 - github.com/gogs/git-module v1.8.4 + github.com/gogs/git-module v1.8.6 github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4 github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0 github.com/gogs/minwinsvc v0.0.0-20170301035411-95be6356811a @@ -131,7 +131,7 @@ require ( go.opentelemetry.io/otel/trace v1.11.0 // indirect golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect golang.org/x/mod v0.29.0 // indirect - golang.org/x/sync v0.18.0 // indirect + golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.38.0 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect diff --git a/go.sum b/go.sum index 8d20a4931..1396aa527 100644 --- a/go.sum +++ b/go.sum @@ -146,8 +146,8 @@ github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBU github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8= github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk= -github.com/gogs/git-module v1.8.4 h1:oSt8sOL4NWOGrSo/CwbS+C4YXtk76QvxyPofem/ViTU= -github.com/gogs/git-module v1.8.4/go.mod h1:bQY0aoMK5Q5+NKgy4jXe3K1GFW+GnsSk0SJK0jh6yD0= +github.com/gogs/git-module v1.8.6 h1:4Io9vWZYQyIjdIPxfKgeYZXnDKNgydc6OZTxII5xCH4= +github.com/gogs/git-module v1.8.6/go.mod h1:IiMSJqi8XH62Kjqjt5Rw8IawSo+DHfM2dDjkSzWLjhs= github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4 h1:C7NryI/RQhsIWwC2bHN601P1wJKeuQ6U/UCOYTn3Cic= github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU= github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0 h1:K02vod+sn3M1OOkdqi2tPxN2+xESK4qyITVQ3JkGEv4= @@ -304,7 +304,6 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 h1:YocNLcTBdEdvY3iDK6jfWXvEaM5OCKkjxPKoJRdB3Gg= github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= @@ -518,9 +517,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/internal/route/api/v1/repo/contents.go b/internal/route/api/v1/repo/contents.go index e247348a8..3f02a73ee 100644 --- a/internal/route/api/v1/repo/contents.go +++ b/internal/route/api/v1/repo/contents.go @@ -137,13 +137,13 @@ func GetContents(c *context.APIContext) { } // The entry is a directory - dir, err := gitRepo.LsTree(entry.ID().String()) + dir, err := gitRepo.LsTree(entry.ID().String(), git.LsTreeOptions{Verbatim: true}) if err != nil { c.NotFoundOrError(gitutil.NewError(err), "get tree") return } - entries, err := dir.Entries() + entries, err := dir.Entries(git.LsTreeOptions{Verbatim: true}) if err != nil { c.NotFoundOrError(gitutil.NewError(err), "list entries") return diff --git a/internal/route/api/v1/repo/tree.go b/internal/route/api/v1/repo/tree.go index 7ace21a83..a3887b32d 100644 --- a/internal/route/api/v1/repo/tree.go +++ b/internal/route/api/v1/repo/tree.go @@ -17,13 +17,13 @@ func GetRepoGitTree(c *context.APIContext) { } sha := c.Params(":sha") - tree, err := gitRepo.LsTree(sha) + tree, err := gitRepo.LsTree(sha, git.LsTreeOptions{Verbatim: true}) if err != nil { c.NotFoundOrError(gitutil.NewError(err), "get tree") return } - entries, err := tree.Entries() + entries, err := tree.Entries(git.LsTreeOptions{Verbatim: true}) if err != nil { c.Error(err, "list entries") return diff --git a/internal/route/repo/view.go b/internal/route/repo/view.go index f8d53ff2a..e83ae8931 100644 --- a/internal/route/repo/view.go +++ b/internal/route/repo/view.go @@ -36,7 +36,7 @@ func renderDirectory(c *context.Context, treeLink string) { return } - entries, err := tree.Entries() + entries, err := tree.Entries(git.LsTreeOptions{Verbatim: true}) if err != nil { c.Error(err, "list entries") return diff --git a/internal/route/repo/wiki.go b/internal/route/repo/wiki.go index 7bbcc6605..7bf92de3a 100644 --- a/internal/route/repo/wiki.go +++ b/internal/route/repo/wiki.go @@ -53,7 +53,7 @@ func renderWikiPage(c *context.Context, isViewPage bool) (*git.Repository, strin // Get page list. if isViewPage { - entries, err := commit.Entries() + entries, err := commit.Entries(git.LsTreeOptions{Verbatim: true}) if err != nil { c.Error(err, "list entries") return nil, "" @@ -155,7 +155,7 @@ func WikiPages(c *context.Context) { return } - entries, err := commit.Entries() + entries, err := commit.Entries(git.LsTreeOptions{Verbatim: true}) if err != nil { c.Error(err, "list entries") return