Validate user refs and reset forced branch targets - #2000
Conversation
Reject branch and tag names that collide with ref syntax, commit hashes, or DoltLite's pseudo-refs through a shared validator. Make forced branch create and copy reset the destination working set, and honor forced rename by replacing the destination with the source branch and its working state. Co-Authored-By: OpenAI Codex <noreply@openai.com>
DoltLite source coverage
Merged 163 pooled raw profiles from the distributed Linux correctness jobs. Per-file coverage (91 files)
|
DoltLite performance vs PR base
blobpk details
compositepk details
int details
textpk details
vc details
All relative performance gates passed. |
|
SummaryCoverage spans branch and tag creation, copying, moving, renaming, resetting, deletion, and transaction handling, including persistence across reopening and visibility across connections. It also exercises edge cases and invalid or adversarial names, malformed operations, dirty working data, schema replacement, rollback behavior, and safe reference resolution, with the tested application behavior broadly healthy. Safe to merge — the only finding is a minor, non-regression validation-message defect unrelated to this PR; it does not create refs or alter existing data. The PR has no attributable failures, so the finding is a flag for later rather than a merge blocker. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. ⚪ Branch dash name shows the wrong error
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |

Summary
-ffor branch rename, replacing the destination ref and carrying the source working set across the renameFailure before
DoltLite accepted ambiguous refs such as
HEAD,WORKING,bad..name, and empty tag names. A forced create or copy updated only the destination tip, leaving its previous dirty working set attached. Forced rename ignored-fand failed whenever the destination existed.The force bug was visible even when both branches pointed at the same commit: after dirtying
victim,dolt_branch('-f', 'victim', 'HEAD')returned success, but reopeningvictimstill exposed the dirty row and a nonemptydolt_status.Validation
test/vc_oracle_branch_test.sh: 45 passed, 0 failedtest/vc_oracle_tags_test.sh: 19 passed, 0 failedtest/run_doltlite_tests.sh build/doltlite: 99/99 suites; 310,162 regression assertionsmake lintgit diff --checkCo-Authored-By: OpenAI Codex noreply@openai.com