mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-03 19:41:24 -05:00
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh
This commit is contained in:
@@ -193,7 +193,7 @@ func (p DoltDatabaseProvider) Database(ctx *sql.Context, name string) (db sql.Da
|
||||
|
||||
if !ok {
|
||||
db, err = p.databaseForClone(ctx, name)
|
||||
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -733,7 +733,7 @@ func (p DoltDatabaseProvider) databaseForRevision(ctx *sql.Context, revDB string
|
||||
if isBranch {
|
||||
// fetch the upstream head if this is a replicated db
|
||||
if replicaDb, ok := srcDb.(ReadReplicaDatabase); ok {
|
||||
// TODO move this out of analysis phase, should only happen at read time, when the transaction begins (like is
|
||||
// TODO move this out of analysis phase, should only happen at read time, when the transaction begins (like is
|
||||
// the case with a branch that already exists locally)
|
||||
err := p.ensureReplicaHeadExists(ctx, resolvedRevSpec, replicaDb)
|
||||
if err != nil {
|
||||
@@ -760,7 +760,7 @@ func (p DoltDatabaseProvider) databaseForRevision(ctx *sql.Context, revDB string
|
||||
if isTag {
|
||||
// TODO: this should be an interface, not a struct
|
||||
replicaDb, ok := srcDb.(ReadReplicaDatabase)
|
||||
|
||||
|
||||
if ok {
|
||||
srcDb = replicaDb.Database
|
||||
}
|
||||
@@ -994,7 +994,7 @@ func (p DoltDatabaseProvider) ensureReplicaHeadExists(ctx *sql.Context, branch s
|
||||
if !branchExists {
|
||||
return db.CreateLocalBranchFromRemote(ctx, ref.NewBranchRef(branch))
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/env/actions"
|
||||
"github.com/dolthub/go-mysql-server/sql"
|
||||
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/env"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/env/actions"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/ref"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
|
||||
"github.com/dolthub/dolt/go/store/datas"
|
||||
@@ -219,13 +219,13 @@ func (rrd ReadReplicaDatabase) PullFromRemote(ctx *sql.Context) error {
|
||||
// CreateLocalBranchFromRemote pulls the given branch from the remote database and creates a local tracking branch for it.
|
||||
func (rrd ReadReplicaDatabase) CreateLocalBranchFromRemote(ctx *sql.Context, branchRef ref.BranchRef) error {
|
||||
_, err := rrd.limiter.Run(ctx, "pullNewBranch", func() (any, error) {
|
||||
// because several clients can queue up waiting to create the same local branch, double check to see if this
|
||||
// because several clients can queue up waiting to create the same local branch, double check to see if this
|
||||
// work was already done and bail early if so
|
||||
_, branchExists, err := rrd.ddb.HasBranch(ctx, branchRef.GetPath())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
if branchExists {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -264,10 +264,10 @@ func (rrd ReadReplicaDatabase) CreateLocalBranchFromRemote(ctx *sql.Context, bra
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
return nil, err
|
||||
})
|
||||
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user