lakectl: switch tracked ref on local checkout even when the commit is unchanged - #10524
Open
ChrisJr404 wants to merge 1 commit into
Open
lakectl: switch tracked ref on local checkout even when the commit is unchanged#10524ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8361
Change Description
Background
lakectl local checkout --ref <other-branch>is supposed to switch the local directory to track a different ref. It works when the new ref points at a different commit, but when the requested ref resolves to the same commit the directory is already at, the tracked ref in.lakefs_ref.yamlis left untouched, so the directory keeps following the ref it was originally checked out from.Bug Fix
localCheckoutonly rewrote the index whennewHead != idx.AtHead, so a ref change with an unchanged head was ignored.Testing Details
Added a unit test for the new
checkoutSwitchesRefpredicate covering same ref/same commit, different ref/same commit (the reported case), same ref/new commit, and different ref/different commit.Breaking Change?
No. Existing checkouts that move to a different commit behave exactly as before.