mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-11 19:31:11 -05:00
using the concurrentmap Map constructor in order to properly initialise the map everywhere it is used
This commit is contained in:
2
go/libraries/doltcore/env/repo_state.go
vendored
2
go/libraries/doltcore/env/repo_state.go
vendored
@@ -181,7 +181,7 @@ func CreateRepoState(fs filesys.ReadWriteFS, br string) (*RepoState, error) {
|
||||
|
||||
rs := &RepoState{
|
||||
Head: ref.MarshalableRef{Ref: headRef},
|
||||
Remotes: &concurrentmap.Map[string, Remote]{},
|
||||
Remotes: concurrentmap.New[string, Remote](),
|
||||
Branches: make(map[string]BranchConfig),
|
||||
Backups: make(map[string]Remote),
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/ref"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/table/editor"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/concurrentmap"
|
||||
)
|
||||
|
||||
const DoltClusterDbName = "dolt_cluster"
|
||||
@@ -111,6 +112,7 @@ func (db database) InitialDBState(ctx *sql.Context) (dsess.InitialDbState, error
|
||||
Rsw: noopRepoStateWriter{},
|
||||
},
|
||||
ReadOnly: true,
|
||||
Remotes: concurrentmap.New[string, env.Remote](),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ func (db Database) getTableInsensitive(ctx *sql.Context, head *doltdb.Commit, ds
|
||||
sess := dsess.DSessFromSess(ctx.Session)
|
||||
adapter := dsess.NewSessionStateAdapter(
|
||||
sess, db.RevisionQualifiedName(),
|
||||
&concurrentmap.Map[string, env.Remote]{},
|
||||
concurrentmap.New[string, env.Remote](),
|
||||
map[string]env.BranchConfig{},
|
||||
map[string]env.Remote{})
|
||||
ws, err := sess.WorkingSet(ctx, db.RevisionQualifiedName())
|
||||
|
||||
@@ -37,6 +37,7 @@ import (
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqlserver"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/table/editor"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/concurrentmap"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/filesys"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/lockutil"
|
||||
"github.com/dolthub/dolt/go/store/datas"
|
||||
@@ -1443,6 +1444,7 @@ func initialStateForTagDb(ctx context.Context, srcDb ReadOnlyDatabase) (dsess.In
|
||||
Rsw: srcDb.DbData().Rsw,
|
||||
Rsr: srcDb.DbData().Rsr,
|
||||
},
|
||||
Remotes: concurrentmap.New[string, env.Remote](),
|
||||
// todo: should we initialize
|
||||
// - Remotes
|
||||
// - Branches
|
||||
@@ -1493,6 +1495,7 @@ func initialStateForCommit(ctx context.Context, srcDb ReadOnlyDatabase) (dsess.I
|
||||
Rsw: srcDb.DbData().Rsw,
|
||||
Rsr: srcDb.DbData().Rsr,
|
||||
},
|
||||
Remotes: concurrentmap.New[string, env.Remote](),
|
||||
// todo: should we initialize
|
||||
// - Remotes
|
||||
// - Branches
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/env"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/table/editor"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/concurrentmap"
|
||||
)
|
||||
|
||||
// UserSpaceDatabase in an implementation of sql.Database for root values. Does not expose any of the internal dolt tables.
|
||||
@@ -84,6 +85,7 @@ func (db *UserSpaceDatabase) InitialDBState(ctx *sql.Context) (dsess.InitialDbSt
|
||||
DbData: env.DbData{
|
||||
Rsw: noopRepoStateWriter{},
|
||||
},
|
||||
Remotes: concurrentmap.New[string, env.Remote](),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user