@@ -37,6 +37,7 @@ import (
3737
3838const  (
3939	lfsAuthenticateVerb  =  "git-lfs-authenticate" 
40+ 	lfsTransferVerb      =  "git-lfs-transfer" 
4041)
4142
4243// CmdServ represents the available serv sub-command. 
7879		"git-upload-archive" : perm .AccessModeRead ,
7980		"git-receive-pack" :   perm .AccessModeWrite ,
8081		lfsAuthenticateVerb :  perm .AccessModeNone ,
82+ 		lfsTransferVerb :      perm .AccessModeNone ,
8183	}
8284	alphaDashDotPattern  =  regexp .MustCompile (`[^\w-\.]` )
8385)
@@ -195,7 +197,7 @@ func runServ(c *cli.Context) error {
195197	}
196198
197199	var  lfsVerb  string 
198- 	if  verb  ==  lfsAuthenticateVerb  {
200+ 	if  verb  ==  lfsAuthenticateVerb  ||   verb   ==   lfsTransferVerb   {
199201		if  ! setting .LFS .StartServer  {
200202			return  fail (ctx , "Unknown git command" , "LFS authentication request over SSH denied, LFS support is disabled" )
201203		}
@@ -245,7 +247,7 @@ func runServ(c *cli.Context) error {
245247		return  fail (ctx , "Unknown git command" , "Unknown git command %s" , verb )
246248	}
247249
248- 	if  verb  ==  lfsAuthenticateVerb  {
250+ 	if  verb  ==  lfsAuthenticateVerb  ||   verb   ==   lfsTransferVerb   {
249251		if  lfsVerb  ==  "upload"  {
250252			requestedMode  =  perm .AccessModeWrite 
251253		} else  if  lfsVerb  ==  "download"  {
@@ -312,6 +314,9 @@ func runServ(c *cli.Context) error {
312314		// by default, use the verb (it has been checked above by allowedCommands) 
313315		gitcmd  =  exec .CommandContext (ctx , gitBinVerb , repoPath )
314316	}
317+ 	if  verb  ==  lfsTransferVerb  {
318+ 		gitcmd .Args  =  append (gitcmd .Args , lfsVerb )
319+ 	}
315320
316321	process .SetSysProcAttribute (gitcmd )
317322	gitcmd .Dir  =  setting .RepoRootPath 
0 commit comments