@@ -145,11 +145,12 @@ impl ApiHandler for MonoApiService {
145145 ///
146146 /// # Returns
147147 ///
148- /// Returns `Ok(())` on success, or a `GitError` on failure.
149- async fn create_monorepo_entry ( & self , entry_info : CreateEntryInfo ) -> Result < ( ) , GitError > {
148+ /// Returns new commit id on success, or a `GitError` on failure.
149+ async fn create_monorepo_entry ( & self , entry_info : CreateEntryInfo ) -> Result < String , GitError > {
150150 let storage = self . storage . mono_storage ( ) ;
151151 let path = PathBuf :: from ( & entry_info. path ) ;
152152 let mut save_trees = vec ! [ ] ;
153+ let last_commit_id: String ;
153154
154155 // Try to get the update chain for the given path.
155156 // If the path exists, return an empty missing_parts and prefix.
@@ -286,6 +287,7 @@ impl ApiHandler for MonoApiService {
286287 } )
287288 . collect ( ) ;
288289 storage. batch_save_model ( save_trees) . await ?;
290+ last_commit_id = new_commit_id;
289291 } else {
290292 // If missing_parts is not empty, we must create intermediate
291293 // directories (trees) for each missing segment. This branch
@@ -395,9 +397,10 @@ impl ApiHandler for MonoApiService {
395397 . batch_save_model ( save_trees)
396398 . await
397399 . map_err ( |e| GitError :: CustomError ( e. to_string ( ) ) ) ?;
400+ last_commit_id = new_commit_id;
398401 }
399402
400- Ok ( ( ) )
403+ Ok ( last_commit_id )
401404 }
402405
403406 fn strip_relative ( & self , path : & Path ) -> Result < PathBuf , MegaError > {
0 commit comments