Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

chore: Change errors.HasType to respect multi-errors #63024

Merged
merged 8 commits into from
Jun 6, 2024
2 changes: 1 addition & 1 deletion cmd/cody-gateway/internal/actor/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (s *sourcesSyncHandler) Handle(ctx context.Context) (err error) {
// If another instance is working on background syncs, we don't want to
// do anything. We should check every time still in case the current worker
// goes offline, we want to be ready to pick up the work.
if err := s.rmux.LockContext(ctx); errors.HasType(err, &redsync.ErrTaken{}) {
if err := s.rmux.LockContext(ctx); errors.HasType[*redsync.ErrTaken](err) {
skippedReason = fmt.Sprintf("did not acquire lock, another worker is likely active: %s", err.Error())
handleLogger.Debug(skippedReason)
return nil // ignore lock contention errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func ListLimitsHandler(baseLogger log.Logger, redisStore limiter.RedisStore) htt
// Capture the current usage.
currentUsage, expiry, err := l.Usage(r.Context())
if err != nil {
if errors.HasType(err, limiter.NoAccessError{}) {
if errors.HasType[limiter.NoAccessError](err) {
// No access to this feature, skip.
continue
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/executor/internal/worker/workspace/firecracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func setupLoopDevice(
// add the error to the bottom of the step's log output,
// but only if this isnt from exec.Command, as those get added
// by our logging wrapper
if !errors.HasType(err, &exec.ExitError{}) {
if !errors.HasType[*exec.ExitError](err) {
fmt.Fprint(handle, err.Error())
}
handle.Finalize(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/graphqlbackend/git_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (r *GitCommitResolver) resolveCommit(ctx context.Context) (*gitdomain.Commi
}

r.commit, r.commitErr = r.gitserverClient.GetCommit(ctx, r.gitRepo, api.CommitID(r.oid))
if r.commitErr != nil && errors.HasType(r.commitErr, &gitdomain.RevisionNotFoundError{}) {
if r.commitErr != nil && errors.HasType[*gitdomain.RevisionNotFoundError](r.commitErr) {
// If the commit is not found, attempt to do a ensure revision call.
_, err := r.gitserverClient.ResolveRevision(ctx, r.gitRepo, string(r.oid), gitserver.ResolveRevisionOptions{EnsureRevision: true})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/graphqlbackend/org_invitations.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func getUserToInviteToOrganization(ctx context.Context, db database.DB, username

if _, err := db.OrgMembers().GetByOrgIDAndUserID(ctx, orgID, userToInvite.ID); err == nil {
return nil, "", errors.New("user is already a member of the organization")
} else if !errors.HasType(err, &database.ErrOrgMemberNotFound{}) {
} else if !errors.HasType[*database.ErrOrgMemberNotFound](err) {
return nil, "", err
}
return userToInvite, userEmailAddress, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ index 9bd8209..d2acfa9 100644
if err == nil {
t.Fatal("unexpected empty err")
}
if !errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if !errors.HasType[*gitdomain.RevisionNotFoundError](err) {
t.Fatalf("incorrect err returned %T", err)
}
})
Expand Down
6 changes: 3 additions & 3 deletions cmd/frontend/graphqlbackend/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (r *RepositoryResolver) Commit(ctx context.Context, args *RepositoryCommitA

commitID, err := backend.NewRepos(r.logger, r.db, r.gitserverClient).ResolveRev(ctx, r.name, args.Rev)
if err != nil {
if errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if errors.HasType[*gitdomain.RevisionNotFoundError](err) {
return nil, nil
}
return nil, err
Expand Down Expand Up @@ -401,7 +401,7 @@ func (r *RepositoryResolver) FirstEverCommit(ctx context.Context) (_ *GitCommitR

commit, err := r.gitserverClient.FirstEverCommit(ctx, repo.Name)
if err != nil {
if errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if errors.HasType[*gitdomain.RevisionNotFoundError](err) {
return nil, nil
}
return nil, err
Expand Down Expand Up @@ -649,7 +649,7 @@ func (r *schemaResolver) ResolvePhabricatorDiff(ctx context.Context, args *struc
}

// If we already created the commit
if commit, err := getCommit(); commit != nil || (err != nil && !errors.HasType(err, &gitdomain.RevisionNotFoundError{})) {
if commit, err := getCommit(); commit != nil || (err != nil && !errors.HasType[*gitdomain.RevisionNotFoundError](err)) {
return commit, err
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/frontend/internal/app/ui/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func newCommon(w http.ResponseWriter, r *http.Request, db database.DB, title str
// Common repo pages (blob, tree, etc).
var err error
common.Repo, common.CommitID, err = handlerutil.GetRepoAndRev(r.Context(), logger, db, mux.Vars(r))
isRepoEmptyError := routevar.ToRepoRev(mux.Vars(r)).Rev == "" && errors.HasType(err, &gitdomain.RevisionNotFoundError{}) // should reply with HTTP 200
isRepoEmptyError := routevar.ToRepoRev(mux.Vars(r)).Rev == "" && errors.HasType[*gitdomain.RevisionNotFoundError](err) // should reply with HTTP 200
if err != nil && !isRepoEmptyError {
var urlMovedError *handlerutil.URLMovedError
if errors.As(err, &urlMovedError) {
Expand All @@ -214,12 +214,12 @@ func newCommon(w http.ResponseWriter, r *http.Request, db database.DB, title str
http.Redirect(w, r, u.String(), http.StatusSeeOther)
return nil, nil
}
if errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if errors.HasType[*gitdomain.RevisionNotFoundError](err) {
// Revision does not exist.
serveError(w, r, db, err, http.StatusNotFound)
return nil, nil
}
if errors.HasType(err, &gitserver.RepoNotCloneableErr{}) {
if errors.HasType[*gitserver.RepoNotCloneableErr](err) {
if errcode.IsNotFound(err) {
// Repository is not found.
serveError(w, r, db, err, http.StatusNotFound)
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/handlerutil/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestGetRepo(t *testing.T) {
})

_, err := GetRepo(context.Background(), logger, dbmocks.NewMockDB(), map[string]string{"Repo": "repo1"})
if !errors.HasType(err, &URLMovedError{}) {
if !errors.HasType[*URLMovedError](err) {
t.Fatalf("err: want type *URLMovedError but got %T", err)
}
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/httpapi/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func AccessTokenAuthMiddleware(db database.DB, baseLogger log.Logger, next http.

subjectUserID, err := db.AccessTokens().Lookup(r.Context(), token, opts)
if err != nil {
if err == database.ErrAccessTokenNotFound || errors.HasType(err, database.InvalidTokenError{}) {
if err == database.ErrAccessTokenNotFound || errors.HasType[database.InvalidTokenError](err) {
anonymousId, anonCookieSet := cookie.AnonymousUID(r)
if !anonCookieSet {
anonymousId = fmt.Sprintf("unknown user @ %s", time.Now()) // we don't have a reliable user identifier at the time of the failure
Expand Down
4 changes: 2 additions & 2 deletions cmd/frontend/internal/httpapi/stream_blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func handleStreamBlame(logger log.Logger, db database.DB, gitserverClient gitser

repo, commitID, err := handlerutil.GetRepoAndRev(r.Context(), logger, db, mux.Vars(r))
if err != nil {
if errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if errors.HasType[*gitdomain.RevisionNotFoundError](err) {
w.WriteHeader(http.StatusNotFound)
} else if errors.HasType(err, &gitserver.RepoNotCloneableErr{}) && errcode.IsNotFound(err) {
} else if errors.HasType[*gitserver.RepoNotCloneableErr](err) && errcode.IsNotFound(err) {
w.WriteHeader(http.StatusNotFound)
} else if errcode.IsNotFound(err) || errcode.IsBlocked(err) {
w.WriteHeader(http.StatusNotFound)
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/notebooks/resolvers/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func validateNotebookWritePermissionsForUser(ctx context.Context, db database.DB
} else if notebook.NamespaceOrgID != 0 {
// Only members of the org have write access to the notebook
membership, err := db.OrgMembers().GetByOrgIDAndUserID(ctx, notebook.NamespaceOrgID, userID)
if errors.HasType(err, &database.ErrOrgMemberNotFound{}) || membership == nil {
if errors.HasType[*database.ErrOrgMemberNotFound](err) || membership == nil {
return errors.New("user is not a member of the notebook organization namespace")
} else if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/notebooks/resolvers/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (r *notebookResolver) Namespace(ctx context.Context) (*graphqlbackend.Names
// On Cloud, the user can have access to an org notebook if it is public. But if the user is not a member of
// that org, then he does not have access to further information about the org. Instead of returning an error
// (which would prevent the user from viewing the notebook) we return an empty namespace.
if dotcom.SourcegraphDotComMode() && errors.HasType(err, &database.OrgNotFoundError{}) {
if dotcom.SourcegraphDotComMode() && errors.HasType[*database.OrgNotFoundError](err) {
return nil, nil
}
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (h *streamHandler) serveHTTP(r *http.Request, tr trace.Trace, eventWriter *
return h.searchClient.Execute(ctx, batchedStream, inputs)
}()

if err != nil && errors.HasType(err, &query.UnsupportedError{}) {
if err != nil && errors.HasType[*query.UnsupportedError](err) {
eventWriter.Alert(search.AlertForQuery(inputs.OriginalQuery, err))
err = nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/webhooks/bitbucketcloud_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (wr *Router) HandleBitbucketCloudWebhook(logger log.Logger, w http.Response
eventType := r.Header.Get("X-Event-Key")
e, err := bitbucketcloud.ParseWebhookEvent(eventType, payload)
if err != nil {
if errors.HasType(err, bitbucketcloud.UnknownWebhookEventKey("")) {
if errors.HasType[bitbucketcloud.UnknownWebhookEventKey](err) {
http.Error(w, err.Error(), http.StatusNotFound)
} else {
http.Error(w, err.Error(), http.StatusInternalServerError)
Expand Down
4 changes: 2 additions & 2 deletions cmd/gitserver/internal/git/gitcli/archivereader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ func TestGitCLIBackend_ArchiveReader(t *testing.T) {
t.Run("non existent commit", func(t *testing.T) {
_, err := backend.ArchiveReader(ctx, "tar", "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", nil)
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})

t.Run("non existent ref", func(t *testing.T) {
_, err := backend.ArchiveReader(ctx, "tar", "head-2", nil)
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})

// Verify that if the context is canceled, the reader returns an error.
Expand Down
4 changes: 2 additions & 2 deletions cmd/gitserver/internal/git/gitcli/blame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ func TestGitCLIBackend_Blame(t *testing.T) {
// Ambiguous ref, could be commit, could be a ref.
_, err := backend.Blame(ctx, "deadbeef", "foo.txt", git.BlameOptions{})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Definitely a commit (yes, those yield different errors from git).
_, err = backend.Blame(ctx, "e3889dff4263a2273459471739aafabc10269885", "foo.txt", git.BlameOptions{})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})

t.Run("file not found", func(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions cmd/gitserver/internal/git/gitcli/commitlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
})
require.NoError(t, err)
_, err = it.Next()
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
_ = it.Close()
})

Expand Down Expand Up @@ -346,7 +346,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
})
require.NoError(t, err)
_, err = it.Next()
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Verify ordering doesn't matter and we return an error for any missing range:
it, err = backend.CommitLog(ctx, git.CommitLogOpts{
Expand All @@ -355,7 +355,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
require.NoError(t, err)
_, err = it.Next()
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Bad commit in range:
it, err = backend.CommitLog(ctx, git.CommitLogOpts{
Expand All @@ -364,7 +364,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
require.NoError(t, err)
_, err = it.Next()
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Bad commit in range LHS:
it, err = backend.CommitLog(ctx, git.CommitLogOpts{
Expand All @@ -373,7 +373,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
require.NoError(t, err)
_, err = it.Next()
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Bad ref in range:
it, err = backend.CommitLog(ctx, git.CommitLogOpts{
Expand All @@ -382,7 +382,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
require.NoError(t, err)
_, err = it.Next()
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Unknown SHA:
it, err = backend.CommitLog(ctx, git.CommitLogOpts{
Expand All @@ -391,7 +391,7 @@ func TestGitCLIBackend_CommitLog(t *testing.T) {
require.NoError(t, err)
_, err = it.Next()
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
// Verify that if the context is canceled, the iterator returns an error.
t.Run("context cancelation", func(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions cmd/gitserver/internal/git/gitcli/contributors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,25 @@ func TestGitCLIBackend_ContributorCounts(t *testing.T) {
Range: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", // Invalid OID
})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

_, err = backend.ContributorCounts(ctx, git.ContributorCountsOpts{
Range: "unknownbranch", // Invalid ref
})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

_, err = backend.ContributorCounts(ctx, git.ContributorCountsOpts{
Range: "unknownbranch..HEAD", // Invalid left hand of range
})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

_, err = backend.ContributorCounts(ctx, git.ContributorCountsOpts{
Range: "HEAD..unknownbranch", // Invalid right hand of range
})
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/gitserver/internal/git/gitcli/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ index 0000000000000000000000000000000000000000..8a6a2d098ecaf90105f1cf2fa90fc460

_, err := backend.RawDiff(ctx, "unknown", "test", git.GitDiffComparisonTypeOnlyInHead)
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

_, err = backend.RawDiff(ctx, "test", "unknown", git.GitDiffComparisonTypeOnlyInHead)
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
t.Run("files outside repository", func(t *testing.T) {
// We use git-diff-tree, but with git-diff you can diff any files on disk
Expand Down Expand Up @@ -250,7 +250,7 @@ func TestGitCLIBackend_ChangedFiles(t *testing.T) {

_, err := backend.ChangedFiles(ctx, "invalid", "HEAD")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})

t.Run("invalid head", func(t *testing.T) {
Expand All @@ -264,7 +264,7 @@ func TestGitCLIBackend_ChangedFiles(t *testing.T) {

_, err := backend.ChangedFiles(ctx, "testbase", "invalid")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})

t.Run("empty base and single commit", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gitserver/internal/git/gitcli/head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestGitCLIBackend_RevParseHead(t *testing.T) {

_, err := backend.RevParseHead(ctx)
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/gitserver/internal/git/gitcli/mergebase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ func TestGitCLIBackend_MergeBase(t *testing.T) {

_, err := backend.MergeBase(ctx, "master", "notfound")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

_, err = backend.MergeBase(ctx, "notfound", "master")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
}
8 changes: 4 additions & 4 deletions cmd/gitserver/internal/git/gitcli/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ func TestGitCLIBackend_GetObject(t *testing.T) {
// Unknown revision.
_, err = backend.GetObject(ctx, "master2")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Unknown commit.
_, err = backend.GetObject(ctx, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

// Invalid commit sha (invalid hex format).
_, err = backend.GetObject(ctx, "notacommitsha")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))

t.Run("HEAD in empty repo", func(t *testing.T) {
backend := BackendWithRepoCommands(t)

_, err := backend.GetObject(ctx, "HEAD")
require.Error(t, err)
require.True(t, errors.HasType(err, &gitdomain.RevisionNotFoundError{}))
require.True(t, errors.HasType[*gitdomain.RevisionNotFoundError](err))
})
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/gitserver/internal/git/gitcli/odb.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (g *gitCLIBackend) Stat(ctx context.Context, commit api.CommitID, path stri
if path == "" || path == "." {
rev, err := g.revParse(ctx, string(commit)+"^{tree}")
if err != nil {
if errors.HasType(err, &gitdomain.RevisionNotFoundError{}) {
if errors.HasType[*gitdomain.RevisionNotFoundError](err) {
return nil, &os.PathError{Op: "ls-tree", Path: path, Err: os.ErrNotExist}
}
return nil, err
Expand Down
Loading
Loading