mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-19 19:21:44 -05:00
dolt commit -a ignores new tables
This commit is contained in:
@@ -103,7 +103,7 @@ func performCommit(ctx context.Context, commandStr string, args []string, dEnv *
|
||||
}
|
||||
|
||||
if allFlag {
|
||||
roots, err = actions.StageAllTables(ctx, roots)
|
||||
roots, err = actions.StageModifiedAndDeletedTables(ctx, roots)
|
||||
if err != nil {
|
||||
return handleCommitErr(ctx, dEnv, err, help)
|
||||
}
|
||||
|
||||
17
go/libraries/doltcore/env/actions/staged.go
vendored
17
go/libraries/doltcore/env/actions/staged.go
vendored
@@ -17,6 +17,7 @@ package actions
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/diff"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
|
||||
)
|
||||
|
||||
@@ -33,6 +34,22 @@ func StageAllTables(ctx context.Context, roots doltdb.Roots) (doltdb.Roots, erro
|
||||
return stageTables(ctx, roots, tbls)
|
||||
}
|
||||
|
||||
func StageModifiedAndDeletedTables(ctx context.Context, roots doltdb.Roots) (doltdb.Roots, error) {
|
||||
_, unstaged, err := diff.GetStagedUnstagedTableDeltas(ctx, roots)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tbls := []string{}
|
||||
for _, tableDelta := range unstaged {
|
||||
if !tableDelta.IsAdd() {
|
||||
tbls = append(tbls, tableDelta.FromName)
|
||||
}
|
||||
}
|
||||
|
||||
return stageTables(ctx, roots, tbls)
|
||||
}
|
||||
|
||||
func stageTables(
|
||||
ctx context.Context,
|
||||
roots doltdb.Roots,
|
||||
|
||||
Reference in New Issue
Block a user