Skip to content

Commit

Permalink
Merge pull request #785 from benjamin-747/main
Browse files Browse the repository at this point in the history
fix issue: push all tags to third-part folder
  • Loading branch information
genedna authored Dec 27, 2024
2 parents cc96619 + 79e17d5 commit c724e48
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions ceres/src/pack/import_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use futures::{future::join_all, StreamExt};
use tokio::sync::mpsc;
use tokio_stream::wrappers::ReceiverStream;

use callisto::{mega_tree, raw_blob};
use callisto::{db_enums::RefType, mega_tree, raw_blob};
use common::errors::MegaError;
use jupiter::{context::Context, storage::batch_save_model};
use mercury::{
Expand Down Expand Up @@ -204,10 +204,7 @@ impl PackHandler for ImportRepo {
}
}

let want_tree_ids = want_commits
.iter()
.map(|c| c.tree_id.to_string())
.collect();
let want_tree_ids = want_commits.iter().map(|c| c.tree_id.to_string()).collect();
let want_trees: HashMap<SHA1, Tree> = storage
.get_trees_by_hashes(self.repo.repo_id, want_tree_ids)
.await
Expand Down Expand Up @@ -342,6 +339,16 @@ impl PackHandler for ImportRepo {
impl ImportRepo {
// attach import repo to monorepo parent tree
async fn attach_to_monorepo_parent(&self) -> Result<(), GitError> {
let iter = self
.command_list
.clone()
.into_iter()
.find(|c| c.ref_type == RefType::Branch);
if iter.is_none() {
return Ok(());
}
let commit_id = iter.unwrap().new_id;

let path = PathBuf::from(self.repo.repo_path.clone());
let mono_api_service = MonoApiService {
context: self.context.clone(),
Expand All @@ -350,12 +357,11 @@ impl ImportRepo {
let save_trees = mono_api_service.search_and_create_tree(&path).await?;

let mut root_ref = storage.get_ref("/").await.unwrap().unwrap();
let commit_id = &self.command_list.first().unwrap().new_id;
let latest_commit: Commit = self
.context
.services
.git_db_storage
.get_commit_by_hash(self.repo.repo_id, commit_id)
.get_commit_by_hash(self.repo.repo_id, &commit_id)
.await
.unwrap()
.unwrap()
Expand Down

1 comment on commit c724e48

@vercel
Copy link

@vercel vercel bot commented on c724e48 Dec 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mega – ./

mega-gitmono.vercel.app
mega-git-main-gitmono.vercel.app
gitmega.dev
www.gitmega.dev

Please sign in to comment.