aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd/git-lfs-server/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/git-lfs-server/main.go b/cmd/git-lfs-server/main.go
index c1b08f6..63b6edf 100644
--- a/cmd/git-lfs-server/main.go
+++ b/cmd/git-lfs-server/main.go
@@ -250,13 +250,13 @@ type operationRequest struct {
250 refspec *string 250 refspec *string
251} 251}
252 252
253func getGitoliteAccess(repo, user, gitolitePerm string, refspec *string) (bool, error) { 253func (h *handler) getGitoliteAccess(repo, user, gitolitePerm string, refspec *string) (bool, error) {
254 // gitolite access -q: returns only exit code 254 // gitolite access -q: returns only exit code
255 gitoliteArgs := []string{"access", "-q", repo, user, gitolitePerm} 255 gitoliteArgs := []string{"access", "-q", repo, user, gitolitePerm}
256 if refspec != nil { 256 if refspec != nil {
257 gitoliteArgs = append(gitoliteArgs, *refspec) 257 gitoliteArgs = append(gitoliteArgs, *refspec)
258 } 258 }
259 cmd := exec.Command("gitolite", gitoliteArgs...) 259 cmd := exec.Command(h.gitolitePath, gitoliteArgs...)
260 err := cmd.Run() 260 err := cmd.Run()
261 if err != nil { 261 if err != nil {
262 var exitErr *exec.ExitError 262 var exitErr *exec.ExitError
@@ -302,7 +302,7 @@ func (h *handler) authorize(ctx context.Context, w http.ResponseWriter, r *http.
302 user = claims.Subject 302 user = claims.Subject
303 } 303 }
304 304
305 readAccess, err := getGitoliteAccess(or.repository, user, "R", or.refspec) 305 readAccess, err := h.getGitoliteAccess(or.repository, user, "R", or.refspec)
306 if err != nil { 306 if err != nil {
307 reqlog(ctx, "Error checking access info: %s", err) 307 reqlog(ctx, "Error checking access info: %s", err)
308 makeRespError(ctx, w, "Failed to query access information", http.StatusInternalServerError) 308 makeRespError(ctx, w, "Failed to query access information", http.StatusInternalServerError)
@@ -313,7 +313,7 @@ func (h *handler) authorize(ctx context.Context, w http.ResponseWriter, r *http.
313 return false 313 return false
314 } 314 }
315 if or.operation == operationUpload { 315 if or.operation == operationUpload {
316 writeAccess, err := getGitoliteAccess(or.repository, user, "W", or.refspec) 316 writeAccess, err := h.getGitoliteAccess(or.repository, user, "W", or.refspec)
317 if err != nil { 317 if err != nil {
318 reqlog(ctx, "Error checking access info: %s", err) 318 reqlog(ctx, "Error checking access info: %s", err)
319 makeRespError(ctx, w, "Failed to query access information", http.StatusInternalServerError) 319 makeRespError(ctx, w, "Failed to query access information", http.StatusInternalServerError)