mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-21 11:29:51 -05:00
updates dolt commit to properly display skip empty commit message
This commit is contained in:
@@ -158,14 +158,21 @@ func performCommit(ctx context.Context, commandStr string, args []string, cliCtx
|
|||||||
return 1, false
|
return 1, false
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _, err = queryist.Query(sqlCtx, q)
|
schema, rowIter, err := queryist.Query(sqlCtx, q)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cli.Println(err.Error())
|
cli.Println(err.Error())
|
||||||
return 1, false
|
return 1, false
|
||||||
}
|
}
|
||||||
|
resultRow, err := sql.RowIterToRows(sqlCtx, schema, rowIter)
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
if resultRow == nil {
|
||||||
|
return 0, true
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: when dolt log is migrated, remove this block printing out the commit and print with a dolt log call in Exec()
|
// TODO: when dolt log is migrated, remove this block printing out the commit and print with a dolt log call in Exec()
|
||||||
schema, rowIter, err := queryist.Query(sqlCtx, "select * from dolt_log() limit 1")
|
schema, rowIter, err = queryist.Query(sqlCtx, "select * from dolt_log() limit 1")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cli.Println(err.Error())
|
cli.Println(err.Error())
|
||||||
return 1, false
|
return 1, false
|
||||||
|
|||||||
@@ -110,8 +110,9 @@ teardown() {
|
|||||||
[ $original_head != $new_head ]
|
[ $original_head != $new_head ]
|
||||||
|
|
||||||
# When no changes are staged, --skip-empty skips creating the commit
|
# When no changes are staged, --skip-empty skips creating the commit
|
||||||
dolt commit --skip-empty -m "commit message"
|
run dolt commit --skip-empty -m "commit message"
|
||||||
[ $new_head = $(get_head_commit) ]
|
[ $new_head = $(get_head_commit) ]
|
||||||
|
[[ "$output" =~ "Skipping empty commit" ]] || false
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "commit: -f works correctly" {
|
@test "commit: -f works correctly" {
|
||||||
|
|||||||
Reference in New Issue
Block a user