8000 git_merge_file_from_index: handle cases when a child (ours or theirs) is null by eantoranz · Pull Request #7092 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

git_merge_file_from_index: handle cases when a child (ours or theirs) is null #7092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eantoranz
Copy link

Within git_merge_file_from_index, it should be possible to handle cases where either one of the children is NULL.

  • When a file is deleted, ancestor and one child will be set and the other one is NULL.
  • When a file is added, one child will be set and ancestor and the other child will be NULL.

Improve git_merge_file_from_index by adding support to having one (or both) children being NULL.

…_index

Improve git_merge_file_from_index by adding suport to missing children.
…est_path

In cases when a path is missing from the ancestor and only of the two
children is defined (IOW, the object is added), then the path in the child
that is defined should be returned.

However, merge_file__best_path is only returning a path in cases when there
is no ancestor path only if both children are defined and they match each
other.

Improve merge_file__best_path by handling the case when it is present in
only one of the children paths returning this value.
@eantoranz eantoranz force-pushed the git_merge_file_from_index-null_child branch from 55eecee to 0370375 Compare June 14, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0