Fixes#9390Fixes#9391
Dolt history table indexes are never marked as unique, regardless of the underlying table’s index properties: prevents unique constraints from being incorrectly reported or exported for history tables
Update the dolt_branch stored procedure to automatically update the
init.defaultbranch configuration when renaming the default branch.
The fix checks if the branch being renamed matches the current
init.defaultbranch config value, and if so, updates it to the new
branch name. This ensures configuration stays synchronized when the
default branch is renamed via SQL.
Only affects the config when renaming the actual default branch -
renaming other branches leaves the configuration unchanged.
Fixes: https://github.com/dolthub/dolt/issues/8039🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add two bats tests to demonstrate and verify behavior of init.defaultbranch
configuration when renaming branches:
1. Test that renaming the default branch should update init.defaultbranch config
(currently fails, demonstrating https://github.com/dolthub/dolt/issues/8039)
2. Test that renaming a non-default branch should not affect init.defaultbranch config
(passes, showing correct behavior for non-default branches)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes: #483
Local/remote refs take priority in Do What I Mean (DWIM) scenarios where dolt has to interpret ambiguous input in checkout.
If a table and tracking branch share the same name, but local does not exist an error will occur.
-- can now be used to clear up ambiguity.
case 1: dolt checkout <ref> -- [<tables>]
<ref> must be a singular valid tree, everything else after '--' must be a table.
case 2: dolt checkout -- [<tables>]
This is case 1 but without <ref>.
case 3: git checkout <something> [--]
(a) If is a commit switch to branch.
(b) If isn’t a commit, and either "--" is present or isn’t a table, no -t or -b is given, and there’s a tracking branch named on exactly one remote (or on the specified remote), then this acts as shorthand to fork local from that remote-tracking branch.
(c) Otherwise, if "--" is present, treat it like case 1.
(d) Otherwise, if a ref treat it like case 1. If a table treat like case 2. If neither fail.
case 4: git checkout <something> <tables>
The first argument must not be ambiguous. If a <ref> follow case 1, if a table follow case 2. Otherwise, fail.