Conversation
3200228 to
98ee0d4
Compare
98ee0d4 to
1c4b6d9
Compare
src/subcommand/merge_subcommand.cpp
Outdated
| else | ||
| { | ||
| msg.append("commit "); | ||
| } |
Member
There was a problem hiding this comment.
These two "if/else" sections can be merged into a single one. Or you could use the ternary operator to initilaze the message in a single line:
std::string msg = merge_ref ? "Merge branch" : "Merge commit'";
src/subcommand/merge_subcommand.cpp
Outdated
| } | ||
|
|
||
| void create_merge_commit(repository_wrapper& repo, const index_wrapper& index, std::vector<std::string> m_branches_to_merge, | ||
| const annotated_commit_list_wrapper& commits_to_merge, size_t num_commits_to_merge) |
Member
There was a problem hiding this comment.
create_merge_commit could be a method of the merge_subcommand class; this way it would have access to the m_changes_to_merge member, and this parameter can be removed. If we prefer to keep it as a free function, then the parameter should be renamed in branches_to_merge (the m_ prefix should be reserved for class members).
JohanMabille
approved these changes
Oct 31, 2025
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.
Add merge commit