mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-04 10:25:17 -06:00
WithDdb -> OnDB
This commit is contained in:
8
go/libraries/doltcore/env/actions/branch.go
vendored
8
go/libraries/doltcore/env/actions/branch.go
vendored
@@ -155,7 +155,7 @@ func DeleteBranchOnDB(ctx context.Context, ddb *doltdb.DoltDB, dref ref.DoltRef,
|
||||
return ddb.DeleteBranch(ctx, dref)
|
||||
}
|
||||
|
||||
func CreateBranchWithDdb(ctx context.Context, ddb *doltdb.DoltDB, newBranch, startingPoint string, force bool, headRef ref.DoltRef) error {
|
||||
func CreateBranchOnDB(ctx context.Context, ddb *doltdb.DoltDB, newBranch, startingPoint string, force bool, headRef ref.DoltRef) error {
|
||||
newRef := ref.NewBranchRef(newBranch)
|
||||
|
||||
hasRef, err := ddb.HasRef(ctx, newRef)
|
||||
@@ -188,7 +188,7 @@ func CreateBranchWithDdb(ctx context.Context, ddb *doltdb.DoltDB, newBranch, sta
|
||||
}
|
||||
|
||||
func CreateBranch(ctx context.Context, dEnv *env.DoltEnv, newBranch, startingPoint string, force bool) error {
|
||||
return CreateBranchWithDdb(ctx, dEnv.DoltDB, newBranch, startingPoint, force, dEnv.RepoState.CWBHeadRef())
|
||||
return CreateBranchOnDB(ctx, dEnv.DoltDB, newBranch, startingPoint, force, dEnv.RepoState.CWBHeadRef())
|
||||
}
|
||||
|
||||
func CheckoutBranch(ctx context.Context, dEnv *env.DoltEnv, brName string) error {
|
||||
@@ -397,10 +397,10 @@ func RootsWithTable(ctx context.Context, dEnv *env.DoltEnv, table string) (RootT
|
||||
}
|
||||
|
||||
func IsBranch(ctx context.Context, dEnv *env.DoltEnv, str string) (bool, error) {
|
||||
return IsBranchWithDdb(ctx, dEnv.DoltDB, str)
|
||||
return IsBranchOnDB(ctx, dEnv.DoltDB, str)
|
||||
}
|
||||
|
||||
func IsBranchWithDdb(ctx context.Context, ddb *doltdb.DoltDB, str string) (bool, error) {
|
||||
func IsBranchOnDB(ctx context.Context, ddb *doltdb.DoltDB, str string) (bool, error) {
|
||||
dref := ref.NewBranchRef(str)
|
||||
return ddb.HasRef(ctx, dref)
|
||||
}
|
||||
|
||||
10
go/libraries/doltcore/env/actions/workspace.go
vendored
10
go/libraries/doltcore/env/actions/workspace.go
vendored
@@ -28,11 +28,11 @@ var ErrCOWorkspaceDelete = errors.New("attempted to delete checked out workspace
|
||||
var ErrBranchNameExists = errors.New("workspace name must not be existing branch name")
|
||||
|
||||
func CreateWorkspace(ctx context.Context, dEnv *env.DoltEnv, name, startPoint string) error {
|
||||
return CreateWorkspaceWithDdb(ctx, dEnv.DoltDB, name, startPoint, dEnv.RepoState.CWBHeadRef())
|
||||
return CreateWorkspaceOnDB(ctx, dEnv.DoltDB, name, startPoint, dEnv.RepoState.CWBHeadRef())
|
||||
}
|
||||
|
||||
func CreateWorkspaceWithDdb(ctx context.Context, ddb *doltdb.DoltDB, name, startPoint string, headRef ref.DoltRef) error {
|
||||
isBranch, err := IsBranchWithDdb(ctx, ddb, name)
|
||||
func CreateWorkspaceOnDB(ctx context.Context, ddb *doltdb.DoltDB, name, startPoint string, headRef ref.DoltRef) error {
|
||||
isBranch, err := IsBranchOnDB(ctx, ddb, name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -67,13 +67,13 @@ func CreateWorkspaceWithDdb(ctx context.Context, ddb *doltdb.DoltDB, name, start
|
||||
return ddb.NewWorkspaceAtCommit(ctx, workRef, cm)
|
||||
}
|
||||
|
||||
func IsWorkspaceWithDdb(ctx context.Context, ddb *doltdb.DoltDB, str string) (bool, error) {
|
||||
func IsWorkspaceOnDB(ctx context.Context, ddb *doltdb.DoltDB, str string) (bool, error) {
|
||||
dref := ref.NewWorkspaceRef(str)
|
||||
return ddb.HasRef(ctx, dref)
|
||||
}
|
||||
|
||||
func IsWorkspace(ctx context.Context, dEnv *env.DoltEnv, str string) (bool, error) {
|
||||
return IsWorkspaceWithDdb(ctx, dEnv.DoltDB, str)
|
||||
return IsWorkspaceOnDB(ctx, dEnv.DoltDB, str)
|
||||
}
|
||||
|
||||
func DeleteWorkspace(ctx context.Context, dEnv *env.DoltEnv, workspaceName string, opts DeleteOptions) error {
|
||||
|
||||
Reference in New Issue
Block a user