From 9ebf0e651465fc304405d0253f837c1b5e929c24 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 12 Jun 2017 13:51:01 +0200 Subject: plumbing/transport: detect "access denied error" "ERR access denied or repository not exported:" is now detected as transport.ErrRepositoryNotFound, since that's what git-daemon returns when --informative-errors is not used. --- plumbing/transport/internal/common/common.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'plumbing') diff --git a/plumbing/transport/internal/common/common.go b/plumbing/transport/internal/common/common.go index 41be776..d947d28 100644 --- a/plumbing/transport/internal/common/common.go +++ b/plumbing/transport/internal/common/common.go @@ -333,11 +333,12 @@ func (s *session) checkNotFoundError() error { } var ( - githubRepoNotFoundErr = "ERROR: Repository not found." - bitbucketRepoNotFoundErr = "conq: repository does not exist." - localRepoNotFoundErr = "does not appear to be a git repository" - gitProtocolNotFoundErr = "ERR \n Repository not found." - gitProtocolNoSuchErr = "ERR no such repository" + githubRepoNotFoundErr = "ERROR: Repository not found." + bitbucketRepoNotFoundErr = "conq: repository does not exist." + localRepoNotFoundErr = "does not appear to be a git repository" + gitProtocolNotFoundErr = "ERR \n Repository not found." + gitProtocolNoSuchErr = "ERR no such repository" + gitProtocolAccessDeniedErr = "ERR access denied" ) func isRepoNotFoundError(s string) bool { @@ -361,6 +362,10 @@ func isRepoNotFoundError(s string) bool { return true } + if strings.HasPrefix(s, gitProtocolAccessDeniedErr) { + return true + } + return false } -- cgit