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 @@ -1183,13 +1183,25 @@ impl MonoApiService {
11831183 ) ;
11841184 let commit_id = commit. id . to_string ( ) ;
11851185 new_commit_id = commit_id. clone ( ) ;
1186+
1187+ // Construct a commit record without a parent commit
1188+ // For details, refer to the `head_hash` method invoked when cloning a repository.
1189+ let c: Commit = Commit :: new (
1190+ commit. author . clone ( ) ,
1191+ commit. committer . clone ( ) ,
1192+ update. tree_id ,
1193+ vec ! [ ] ,
1194+ & commit. message ,
1195+ ) ;
1196+
11861197 commits. push ( commit) ;
1198+ commits. push ( c. clone ( ) ) ;
11871199
11881200 let mut push_update = |ref_name : & str | {
11891201 updates. push ( RefUpdateData {
11901202 path : p_ref. path . clone ( ) ,
11911203 ref_name : ref_name. to_string ( ) ,
1192- commit_id : commit_id . clone ( ) ,
1204+ commit_id : c . id . to_string ( ) . clone ( ) ,
11931205 tree_hash : update. tree_id . to_string ( ) ,
11941206 } ) ;
11951207 } ;
You can’t perform that action at this time.
0 commit comments