File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1130,6 +1130,18 @@ int git_reference__update_terminal(
11301130 return error ;
11311131}
11321132
1133+ static const char * commit_type (const git_commit * commit )
1134+ {
1135+ unsigned int count = git_commit_parentcount (commit );
1136+
1137+ if (count >= 2 )
1138+ return " (merge)" ;
1139+ else if (count == 0 )
1140+ return " (initial)" ;
1141+ else
1142+ return "" ;
1143+ }
1144+
11331145int git_reference__update_for_commit (
11341146 git_repository * repo ,
11351147 git_reference * ref ,
@@ -1146,7 +1158,7 @@ int git_reference__update_for_commit(
11461158 if ((error = git_commit_lookup (& commit , repo , id )) < 0 ||
11471159 (error = git_buf_printf (& reflog_msg , "%s%s: %s" ,
11481160 operation ? operation : "commit" ,
1149- git_commit_parentcount (commit ) == 0 ? " (initial)" : "" ,
1161+ commit_type (commit ),
11501162 git_commit_summary (commit ))) < 0 )
11511163 goto done ;
11521164
You can’t perform that action at this time.
0 commit comments