From 8a31c5b861e50059f5b6d201635b14b0c37afd3c Mon Sep 17 00:00:00 2001 From: Nick Thomas <nick@gitlab.com> Date: Tue, 11 Dec 2018 11:27:12 +0000 Subject: [PATCH] Remove RepoPath from the API response --- gitaly_test.go | 1 - internal/api/api.go | 6 +----- main_test.go | 9 --------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/gitaly_test.go b/gitaly_test.go index e98bf42d80546..e483b8ce40646 100644 --- a/gitaly_test.go +++ b/gitaly_test.go @@ -36,7 +36,6 @@ func TestFailedCloneNoGitaly(t *testing.T) { authBody := &api.Response{ GL_ID: "user-123", GL_USERNAME: "username", - RepoPath: repoPath(t), // This will create a failure to connect to Gitaly GitalyServer: gitaly.Server{Address: "unix:/nonexistent"}, } diff --git a/internal/api/api.go b/internal/api/api.go index d4611adefaa63..36a6e88b92f1d 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -106,9 +106,6 @@ type Response struct { // GL_REPOSITORY is an environment variable used by gitlab-shell hooks during // 'git push' and 'git pull' GL_REPOSITORY string - // RepoPath is the full path on disk to the Git repository the request is - // about - RepoPath string // GitConfigOptions holds the custom options that we want to pass to the git command GitConfigOptions []string // StoreLFSPath is provided by the GitLab Rails application to mark where the tmp file should be placed. @@ -132,8 +129,7 @@ type Response struct { Terminal *TerminalSettings // GitalyServer specifies an address and authentication token for a gitaly server we should connect to. GitalyServer gitaly.Server - // Repository object for making gRPC requests to Gitaly. This will - // eventually replace the RepoPath field. + // Repository object for making gRPC requests to Gitaly. Repository pb.Repository // For git-http, does the requestor have the right to view all refs? ShowAllRefs bool diff --git a/main_test.go b/main_test.go index 606928a8e53f6..cbc2fb932ca4b 100644 --- a/main_test.go +++ b/main_test.go @@ -522,11 +522,9 @@ func runOrFail(t *testing.T, cmd *exec.Cmd) { } func gitOkBody(t *testing.T) *api.Response { - repoPath := repoPath(t) return &api.Response{ GL_ID: "user-123", GL_USERNAME: "username", - RepoPath: repoPath, Repository: pb.Repository{ StorageName: "default", RelativePath: "foo/bar.git", @@ -534,13 +532,6 @@ func gitOkBody(t *testing.T) *api.Response { } } -func repoPath(t *testing.T) string { - cwd, err := os.Getwd() - require.NoError(t, err) - - return path.Join(cwd, testRepoRoot, testRepo) -} - func httpGet(t *testing.T, url string, headers map[string]string) (*http.Response, string) { req, err := http.NewRequest("GET", url, nil) require.NoError(t, err) -- GitLab