Guard recursive update for undefined SQUASH_COMMIT#9
Merged
Conversation
45f351e to
3d42e54
Compare
Extract is_base_ancestor() for simple ancestry checks that work in all modes. Rename skip_if_clean to has_squash_commit for clarity - it returns a boolean, not performs an action. update_indirect_target now uses is_base_ancestor() since indirect targets only need to verify their parent is already an ancestor. has_squash_commit remains for direct targets in squash-merge mode, where checking both base ancestry AND squash commit presence is needed. Also add feature4 branch to e2e tests to verify grandchildren are properly updated during conflict resolution continuation workflow.
3d42e54 to
ea1f0bb
Compare
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.
In conflict-resolved mode, SQUASH_COMMIT is never initialized (git update-ref SQUASH_COMMIT only happens in main()), causing skip_if_clean to crash with "invalid object name" when update_branch_recursive processes grandchildren branches.
Add a guard to check if the SQUASH_COMMIT ref exists before attempting to use it. If the ref doesn't exist, return false to indicate the branch needs updating.
Also add feature4 branch to e2e tests to verify grandchildren are properly updated during conflict resolution continuation workflow.