Merge pull request #1521 from alrs/doltcore-env-errs

fixed dropped errors in libraries/doltcore/env
This commit is contained in:
Zach Musgrave
2021-04-13 15:51:56 -07:00
committed by GitHub
3 changed files with 8 additions and 7 deletions

View File

@@ -88,10 +88,13 @@ func loadDoltCliConfig(hdp HomeDirProvider, fs filesys.ReadWriteFS) (*DoltCliCon
ch := config.NewConfigHierarchy()
gPath, err := getGlobalCfgPath(hdp)
if err != nil {
return nil, err
}
lPath := getLocalConfigPath()
gCfg, err := ensureGlobalConfig(gPath, fs)
if err != nil {
return nil, err
}

View File

@@ -522,38 +522,35 @@ func (dEnv *DoltEnv) UpdateStagedRoot(ctx context.Context, newRoot *doltdb.RootV
// todo: move this out of env to actions
func (dEnv *DoltEnv) PutTableToWorking(ctx context.Context, sch schema.Schema, rows types.Map, indexData types.Map, tableName string, autoVal types.Value) error {
root, err := dEnv.WorkingRoot(ctx)
if err != nil {
return doltdb.ErrNomsIO
}
vrw := dEnv.DoltDB.ValueReadWriter()
schVal, err := encoding.MarshalSchemaAsNomsValue(ctx, vrw, sch)
if err != nil {
return ErrMarshallingSchema
}
tbl, err := doltdb.NewTable(ctx, vrw, schVal, rows, indexData, autoVal)
if err != nil {
return err
}
newRoot, err := root.PutTable(ctx, tableName, tbl)
if err != nil {
return err
}
rootHash, err := root.HashOf()
if err != nil {
return err
}
newRootHash, err := newRoot.HashOf()
if err != nil {
return err
}
if rootHash == newRootHash {
return nil
}

View File

@@ -142,6 +142,7 @@ func UpdateTables(t *testing.T, ctx context.Context, root *doltdb.RootValue, tbl
}
schVal, err := encoding.MarshalSchemaAsNomsValue(ctx, root.VRW(), sch)
require.NoError(t, err)
indexData, err := types.NewMap(ctx, root.VRW())
require.NoError(t, err)