@@ -45,11 +45,11 @@ func spawnCommand(command string) error {
4545
4646func main () {
4747 // expect args:
48- // lfs-ssh-echo -p PORT -- [email protected] git-lfs-authenticate REPO OPERATION 49- // lfs-ssh-echo -p PORT -- [email protected] git-lfs-transfer REPO OPERATION 50- // lfs-ssh-echo -- [email protected] git-lfs-transfer REPO OPERATION 51- // lfs-ssh-echo [email protected] git-upload-pack REPO 52- // lfs-ssh-echo [email protected] git-receive-pack REPO 48+ // lfs-ssh-echo -p PORT -- [email protected] " git-lfs-authenticate REPO OPERATION" 49+ // lfs-ssh-echo -p PORT -- [email protected] " git-lfs-transfer REPO OPERATION" 50+ // lfs-ssh-echo -- [email protected] " git-lfs-transfer REPO OPERATION" 51+ // lfs-ssh-echo [email protected] " git-upload-pack REPO" 52+ // lfs-ssh-echo [email protected] " git-receive-pack REPO" 5353 if len (os .Args ) < 3 {
5454 fmt .Fprintf (os .Stderr , "got %d args: %v" , len (os .Args ), os .Args )
5555 os .Exit (1 )
@@ -82,17 +82,17 @@ func main() {
8282 os .Exit (1 )
8383 }
8484
85- // just "git-lfs-authenticate REPO OPERATION"
86- authLine := strings .Split (os .Args [offset + 1 ], " " )
87- if len (authLine ) < 2 {
85+ // just "git-lfs-authenticate REPO OPERATION" or "git-(upload|receive)-pack REPO"
86+ remoteCmd := strings .Split (os .Args [offset + 1 ], " " )
87+ if len (remoteCmd ) < 2 {
8888 fmt .Fprintf (os .Stderr , "bad git-lfs-authenticate line: %s\n args: %v" , authLine , os .Args )
8989 os .Exit (1 )
9090 }
9191
92- if authLine [0 ] == "git-lfs-transfer" || authLine [0 ] == "git-upload-pack" || authLine [0 ] == "git-receive-pack" {
92+ if remoteCmd [0 ] == "git-lfs-transfer" || remoteCmd [0 ] == "git-upload-pack" || remoteCmd [0 ] == "git-receive-pack" {
9393 err := spawnCommand (os .Args [offset + 1 ])
9494 if err != nil {
95- fmt .Fprintf (os .Stderr , "error running command %q: %v" , authLine [0 ], err )
95+ fmt .Fprintf (os .Stderr , "error running command %q: %v" , remoteCmd [0 ], err )
9696 os .Exit (1 )
9797 }
9898 return
0 commit comments