@@ -85,6 +85,10 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
8585 "/owner/repo/releases/download/tag/repo.tar.gz" ,
8686 true ,
8787 },
88+ {
89+ "/owner/repo/attachments/6d92a9ee-5d8b-4993-97c9-6181bdaa8955" ,
90+ true ,
91+ },
8892 }
8993 lfsTests := []string {
9094 "/owner/repo/info/lfs/" ,
@@ -104,11 +108,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
104108 t .Run (tt .path , func (t * testing.T ) {
105109 req , _ := http .NewRequest ("POST" , "http://localhost" + tt .path , nil )
106110 setting .LFS .StartServer = false
107- if got := isGitRawReleaseOrLFSPath (req ); got != tt .want {
111+ if got := isGitRawOrAttachOrLFSPath (req ); got != tt .want {
108112 t .Errorf ("isGitOrLFSPath() = %v, want %v" , got , tt .want )
109113 }
110114 setting .LFS .StartServer = true
111- if got := isGitRawReleaseOrLFSPath (req ); got != tt .want {
115+ if got := isGitRawOrAttachOrLFSPath (req ); got != tt .want {
112116 t .Errorf ("isGitOrLFSPath() = %v, want %v" , got , tt .want )
113117 }
114118 })
@@ -117,11 +121,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
117121 t .Run (tt , func (t * testing.T ) {
118122 req , _ := http .NewRequest ("POST" , tt , nil )
119123 setting .LFS .StartServer = false
120- if got := isGitRawReleaseOrLFSPath (req ); got != setting .LFS .StartServer {
121- t .Errorf ("isGitOrLFSPath(%q) = %v, want %v, %v" , tt , got , setting .LFS .StartServer , gitRawReleasePathRe .MatchString (tt ))
124+ if got := isGitRawOrAttachOrLFSPath (req ); got != setting .LFS .StartServer {
125+ t .Errorf ("isGitOrLFSPath(%q) = %v, want %v, %v" , tt , got , setting .LFS .StartServer , gitRawOrAttachPathRe .MatchString (tt ))
122126 }
123127 setting .LFS .StartServer = true
124- if got := isGitRawReleaseOrLFSPath (req ); got != setting .LFS .StartServer {
128+ if got := isGitRawOrAttachOrLFSPath (req ); got != setting .LFS .StartServer {
125129 t .Errorf ("isGitOrLFSPath(%q) = %v, want %v" , tt , got , setting .LFS .StartServer )
126130 }
127131 })
0 commit comments