@@ -85,6 +85,10 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
85
85
"/owner/repo/releases/download/tag/repo.tar.gz" ,
86
86
true ,
87
87
},
88
+ {
89
+ "/owner/repo/attachments/6d92a9ee-5d8b-4993-97c9-6181bdaa8955" ,
90
+ true ,
91
+ },
88
92
}
89
93
lfsTests := []string {
90
94
"/owner/repo/info/lfs/" ,
@@ -104,11 +108,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
104
108
t .Run (tt .path , func (t * testing.T ) {
105
109
req , _ := http .NewRequest ("POST" , "http://localhost" + tt .path , nil )
106
110
setting .LFS .StartServer = false
107
- if got := isGitRawReleaseOrLFSPath (req ); got != tt .want {
111
+ if got := isGitRawOrAttachOrLFSPath (req ); got != tt .want {
108
112
t .Errorf ("isGitOrLFSPath() = %v, want %v" , got , tt .want )
109
113
}
110
114
setting .LFS .StartServer = true
111
- if got := isGitRawReleaseOrLFSPath (req ); got != tt .want {
115
+ if got := isGitRawOrAttachOrLFSPath (req ); got != tt .want {
112
116
t .Errorf ("isGitOrLFSPath() = %v, want %v" , got , tt .want )
113
117
}
114
118
})
@@ -117,11 +121,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) {
117
121
t .Run (tt , func (t * testing.T ) {
118
122
req , _ := http .NewRequest ("POST" , tt , nil )
119
123
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 ))
122
126
}
123
127
setting .LFS .StartServer = true
124
- if got := isGitRawReleaseOrLFSPath (req ); got != setting .LFS .StartServer {
128
+ if got := isGitRawOrAttachOrLFSPath (req ); got != setting .LFS .StartServer {
125
129
t .Errorf ("isGitOrLFSPath(%q) = %v, want %v" , tt , got , setting .LFS .StartServer )
126
130
}
127
131
})
0 commit comments