Commit 51fe7f28 authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker

don't make up exitCodes

parent 3c1e6316
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32, error) { func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32, error) {
if gitalyAddress == "" { if gitalyAddress == "" {
return -1, fmt.Errorf("no gitaly_address given") return 0, fmt.Errorf("no gitaly_address given")
} }
connOpts := client.DefaultDialOpts connOpts := client.DefaultDialOpts
...@@ -24,11 +24,11 @@ func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32 ...@@ -24,11 +24,11 @@ func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32
conn, err := client.Dial(gitalyAddress, connOpts) conn, err := client.Dial(gitalyAddress, connOpts)
if err != nil { if err != nil {
return -1, err return 0, err
} }
defer conn.Close() defer conn.Close()
ctx, cancel := context.WithCancel(context.TODO()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
return client.ReceivePack(ctx, conn, os.Stdin, os.Stdout, os.Stderr, request) return client.ReceivePack(ctx, conn, os.Stdin, os.Stdout, os.Stderr, request)
} }
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32, error) { func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32, error) {
if gitalyAddress == "" { if gitalyAddress == "" {
return -1, fmt.Errorf("no gitaly_address given") return 0, fmt.Errorf("no gitaly_address given")
} }
connOpts := client.DefaultDialOpts connOpts := client.DefaultDialOpts
...@@ -24,11 +24,11 @@ func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32, ...@@ -24,11 +24,11 @@ func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32,
conn, err := client.Dial(gitalyAddress, connOpts) conn, err := client.Dial(gitalyAddress, connOpts)
if err != nil { if err != nil {
return -1, err return 0, err
} }
defer conn.Close() defer conn.Close()
ctx, cancel := context.WithCancel(context.TODO()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
return client.UploadPack(ctx, conn, os.Stdin, os.Stdout, os.Stderr, request) return client.UploadPack(ctx, conn, os.Stdin, os.Stdout, os.Stderr, request)
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment