@@ -57,8 +57,11 @@ void perform_fastforward(repository_wrapper& repo, const git_oid target_oid, int
5757 target_ref.write_new_ref (target_oid);
5858}
5959
60- void create_merge_commit (repository_wrapper& repo, const index_wrapper& index, std::vector<std::string> m_branches_to_merge,
61- const annotated_commit_list_wrapper& commits_to_merge, size_t num_commits_to_merge)
60+ void merge_subcommand::create_merge_commit (
61+ repository_wrapper& repo,
62+ const index_wrapper& index,
63+ const annotated_commit_list_wrapper& commits_to_merge,
64+ size_t num_commits_to_merge)
6265{
6366 auto head_ref = repo.head ();
6467 auto merge_ref = repo.find_reference_dwim (m_branches_to_merge.front ());
@@ -90,16 +93,7 @@ void create_merge_commit(repository_wrapper& repo, const index_wrapper& index, s
9093 {
9194 msg_target = git_oid_tostr_s (&(merge_commit.oid ()));
9295 }
93-
94- std::string msg = " Merge " ;
95- if (merge_ref)
96- {
97- msg.append (" branch " );
98- }
99- else
100- {
101- msg.append (" commit " );
102- }
96+ std::string msg = merge_ref ? " Merge branch " : " Merge commit " ;
10397 msg.append (msg_target);
10498
10599 repo.create_commit (author_committer_sign_now, msg, std::optional<commit_list_wrapper>(std::move (parents)));
@@ -183,7 +177,7 @@ void merge_subcommand::run()
183177 }
184178 else if (!m_no_commit)
185179 {
186- create_merge_commit (repo, index, m_branches_to_merge, commits_to_merge, num_commits_to_merge);
180+ create_merge_commit (repo, index, commits_to_merge, num_commits_to_merge);
187181 printf (" Merge made\n " );
188182 }
189183}
0 commit comments