Skip to content

Commit

Permalink
Properly handle cinnabar.graft URL values in git cinnabar unbundle
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Feb 24, 2025
1 parent be6aa2a commit 552d959
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ use cstr::cstr;
use digest::OutputSizeUser;
use either::Either;
use git::{BlobId, CommitId, GitObjectId, RawBlob, RawCommit, RawTree, RecursedTreeEntry, TreeIsh};
use graft::{graft_finish, grafted, maybe_init_graft};
use graft::{graft_finish, grafted, init_graft, maybe_init_graft};
use hg::{HgChangesetId, HgFileId, HgManifestId, ManifestEntry};
use hg_bundle::{create_bundle, create_chunk_data, read_rev_chunk, BundleSpec, RevChunkIter};
use hg_connect::{
Expand Down Expand Up @@ -2182,6 +2182,10 @@ fn do_unbundle(store: &mut Store, clonebundle: bool, mut url: OsString) -> Resul
get_connection(&url).unwrap()
};

if !has_metadata(store) && matches!(graft_config_enabled(None), Ok(Some(Either::Right(_)))) {
init_graft(store, true);
}

get_store_bundle(store, &mut *conn, &[], &[])
.map_err(|e| String::from_utf8_lossy(&e).into_owned())?;

Expand Down

0 comments on commit 552d959

Please sign in to comment.