Skip to content

Commit

Permalink
LFS: Fix SSH authentication for trailing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-z committed Mar 19, 2017
1 parent 8bcb643 commit 3e47ae0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/serv.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func runServ(c *cli.Context) error {
fail("Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
}

if strings.Contains(args, " ") {
argsSplit := strings.SplitN(args, " ", 2)
argsSplit := strings.Split(args, " ")
if len(argsSplit) >= 2 {
args = strings.TrimSpace(argsSplit[0])
lfsVerb = strings.TrimSpace(argsSplit[1])
}
Expand Down Expand Up @@ -179,8 +179,10 @@ func runServ(c *cli.Context) error {
if verb == lfsAuthenticateVerb {
if lfsVerb == "upload" {
requestedMode = models.AccessModeWrite
} else {
} else if lfsVerb == "download" {
requestedMode = models.AccessModeRead
} else {
fail("Unknown LFS verb", "Unkown lfs verb %s", lfsVerb)
}
}

Expand Down

0 comments on commit 3e47ae0

Please sign in to comment.