Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comment unused code
  • Loading branch information
SandrineP committed Oct 28, 2025
commit 7d7ec312f1c403e07d2244f8699859e35f8df527
26 changes: 13 additions & 13 deletions src/subcommand/merge_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ void merge_subcommand::run()
assert(num_commits_to_merge == 1);
Comment thread
ianthomas23 marked this conversation as resolved.
perform_fastforward(repo, target_oid, (analysis & GIT_MERGE_ANALYSIS_UNBORN));
}
else if (analysis & GIT_MERGE_ANALYSIS_NORMAL)
{
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
// else if (analysis & GIT_MERGE_ANALYSIS_NORMAL)
// {
// git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
// git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;

merge_opts.flags = 0;
merge_opts.file_flags = GIT_MERGE_FILE_STYLE_DIFF3;
// merge_opts.flags = 0;
// merge_opts.file_flags = GIT_MERGE_FILE_STYLE_DIFF3;

checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE|GIT_CHECKOUT_ALLOW_CONFLICTS;
// checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE|GIT_CHECKOUT_ALLOW_CONFLICTS;

if (preference & GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY)
{
std::cout << "Fast-forward is preferred, but only a merge is possible\n" << std::endl;
// how to break ?
}
// if (preference & GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY)
// {
// std::cout << "Fast-forward is preferred, but only a merge is possible\n" << std::endl;
// // how to break ?
// }

// git_merge(repo,
// (const git_annotated_commit **)opts.annotated, opts.annotated_count,
Expand All @@ -179,4 +179,4 @@ void merge_subcommand::run()
// create_merge_commit(repo, index, &opts);
// printf("Merge made\n");
// }
}
// }
1 change: 1 addition & 0 deletions test/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


# TODO: Have a different "person" for the commit and for the merge
# TODO: Test "unborn" case, but how ?
def test_merge_fast_forward(xtl_clone, git_config, git2cpp_path, tmp_path, monkeypatch):
assert (tmp_path / "xtl").exists()
xtl_path = tmp_path / "xtl"
Expand Down