From 67006337df88a3fdd97cd13b39a103657db2ab05 Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Tue, 20 Dec 2016 15:43:49 +0200 Subject: [PATCH] Use gitaly-client as a blueprint for all required git binaries --- .gitignore | 4 ++++ Makefile | 7 +++++++ cmd/client/main.go | 2 -- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c1c3d99445f..fac71df77b1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ _build vendor/*/ git-daemon-client git-daemon-server +git +git-upload-archive +git-upload-pack +git-receive-pack diff --git a/Makefile b/Makefile index bf61ec5da84..c2884a1768f 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ PKG=gitlab.com/gitlab-org/git-access-daemon BUILD_DIR=$(shell pwd) CLIENT_BIN=git-daemon-client SERVER_BIN=git-daemon-server +GIT_BINARIES=git git-upload-archive git-upload-pack git-receive-pack export GOPATH=${BUILD_DIR}/_build export PATH:=${GOPATH}/bin:$(PATH) @@ -22,6 +23,9 @@ deps: ${BUILD_DIR}/_build build: deps go build -o ${SERVER_BIN} cmd/server/main.go go build -o ${CLIENT_BIN} cmd/client/main.go + for bin in ${GIT_BINARIES}; do \ + cp ${CLIENT_BIN} $$bin; \ + done test: ${BUILD_DIR}/_build deps cd ${BUILD_DIR}/_build/src/${PKG}/server && go test -v @@ -32,3 +36,6 @@ clean: rm -rf client/testdata [ -f ${CLIENT_BIN} ] && rm ${CLIENT_BIN} [ -f ${SERVER_BIN} ] && rm ${SERVER_BIN} + for bin in ${GIT_BINARIES}; do \ + [ -f $$bin ] && rm $$bin; \ + done diff --git a/cmd/client/main.go b/cmd/client/main.go index b00413fe6da..4f1ae850873 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -10,8 +10,6 @@ func main() { client := client.NewClient("127.0.0.1:6666") defer client.Close() - os.Args[0] = "git" - exitStatus := client.Run(os.Args) os.Exit(exitStatus) } -- GitLab