@@ -37,6 +37,7 @@ import (
37
37
38
38
const (
39
39
lfsAuthenticateVerb = "git-lfs-authenticate"
40
+ lfsTransferVerb = "git-lfs-transfer"
40
41
)
41
42
42
43
// CmdServ represents the available serv sub-command.
78
79
"git-upload-archive" : perm .AccessModeRead ,
79
80
"git-receive-pack" : perm .AccessModeWrite ,
80
81
lfsAuthenticateVerb : perm .AccessModeNone ,
82
+ lfsTransferVerb : perm .AccessModeNone ,
81
83
}
82
84
alphaDashDotPattern = regexp .MustCompile (`[^\w-\.]` )
83
85
)
@@ -195,7 +197,7 @@ func runServ(c *cli.Context) error {
195
197
}
196
198
197
199
var lfsVerb string
198
- if verb == lfsAuthenticateVerb {
200
+ if verb == lfsAuthenticateVerb || verb == lfsTransferVerb {
199
201
if ! setting .LFS .StartServer {
200
202
return fail (ctx , "Unknown git command" , "LFS authentication request over SSH denied, LFS support is disabled" )
201
203
}
@@ -245,7 +247,7 @@ func runServ(c *cli.Context) error {
245
247
return fail (ctx , "Unknown git command" , "Unknown git command %s" , verb )
246
248
}
247
249
248
- if verb == lfsAuthenticateVerb {
250
+ if verb == lfsAuthenticateVerb || verb == lfsTransferVerb {
249
251
if lfsVerb == "upload" {
250
252
requestedMode = perm .AccessModeWrite
251
253
} else if lfsVerb == "download" {
@@ -312,6 +314,9 @@ func runServ(c *cli.Context) error {
312
314
// by default, use the verb (it has been checked above by allowedCommands)
313
315
gitcmd = exec .CommandContext (ctx , gitBinVerb , repoPath )
314
316
}
317
+ if verb == lfsTransferVerb {
318
+ gitcmd .Args = append (gitcmd .Args , lfsVerb )
319
+ }
315
320
316
321
process .SetSysProcAttribute (gitcmd )
317
322
gitcmd .Dir = setting .RepoRootPath
0 commit comments