pr feedback

This commit is contained in:
Andy Arthur
2020-11-23 12:47:49 -08:00
parent 66d45ac5b0
commit fee068af4c
2 changed files with 25 additions and 1 deletions

View File

@@ -224,3 +224,27 @@ function setup_write_test {
[[ "$output" =~ "1,2" ]] || false
[[ "$output" =~ "1,2" ]] || false
}
@test "filter-branch error on incorrect schema" {
setup_write_test
dolt sql <<SQL
ALTER TABLE test ADD COLUMN c1 int;
INSERT INTO test VALUES (6,6,6);
SQL
dolt add -A && dolt commit -m "added column c1"
run dolt filter-branch "INSERT INTO test VALUES (9,9);"
[ "$status" -ne 0 ]
[[ ! "$output" =~ "panic" ]] || false
run dolt filter-branch "INSERT INTO test (pk,c0) VALUES (9,9);"
[ "$status" -eq 0 ]
run dolt sql -q "SELECT pk,c0 FROM dolt_history_test WHERE pk=9;" -r csv
[ "$status" -eq 0 ]
[[ "$output" =~ "9,9" ]] || false
[[ "$output" =~ "9,9" ]] || false
[[ "$output" =~ "9,9" ]] || false
[[ "$output" =~ "9,9" ]] || false
}

View File

@@ -60,7 +60,7 @@ func StopAtCommit(stopCommit *doltdb.Commit) NeedsRebaseFn {
return false, err
}
if n == 0 {
return false, fmt.Errorf("commit %s not found in history", sh)
return false, fmt.Errorf("commit %s is missing from the commit history of at least one rebase head", sh)
}
return true, nil