radicle: add .external_template(false) to all other libgit2 calls
This complements 9d4aa59a12.
This commit is contained in:
parent
ab62dce683
commit
e30e66e009
|
|
@ -764,7 +764,12 @@ fn print_diff(
|
||||||
let current = serde_json::to_string_pretty(¤t.doc)?;
|
let current = serde_json::to_string_pretty(¤t.doc)?;
|
||||||
|
|
||||||
let tmp = tempfile::tempdir()?;
|
let tmp = tempfile::tempdir()?;
|
||||||
let repo = radicle::git::raw::Repository::init_bare(tmp.path())?;
|
let repo = radicle::git::raw::Repository::init_opts(
|
||||||
|
tmp.path(),
|
||||||
|
radicle::git::raw::RepositoryInitOptions::new()
|
||||||
|
.external_template(false)
|
||||||
|
.bare(true),
|
||||||
|
)?;
|
||||||
|
|
||||||
let previous = if let Some(previous) = previous {
|
let previous = if let Some(previous) = previous {
|
||||||
let tree = radicle::git::write_tree(&doc::PATH, previous.as_bytes(), &repo)?;
|
let tree = radicle::git::write_tree(&doc::PATH, previous.as_bytes(), &repo)?;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,11 @@ pub struct Storage {
|
||||||
impl Storage {
|
impl Storage {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let temp = tempfile::tempdir().unwrap();
|
let temp = tempfile::tempdir().unwrap();
|
||||||
let raw = git2::Repository::init(temp.path()).unwrap();
|
let raw = git2::Repository::init_opts(
|
||||||
|
temp.path(),
|
||||||
|
git2::RepositoryInitOptions::new().external_template(false),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
let mut config = raw.config().unwrap();
|
let mut config = raw.config().unwrap();
|
||||||
config.set_str("user.name", "Terry Pratchett").unwrap();
|
config.set_str("user.name", "Terry Pratchett").unwrap();
|
||||||
config
|
config
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,11 @@ where
|
||||||
|
|
||||||
/// Creates a regular repository at the given path with a couple of commits.
|
/// Creates a regular repository at the given path with a couple of commits.
|
||||||
pub fn repository<P: AsRef<Path>>(path: P) -> (git2::Repository, git2::Oid) {
|
pub fn repository<P: AsRef<Path>>(path: P) -> (git2::Repository, git2::Oid) {
|
||||||
let repo = git2::Repository::init(path).unwrap();
|
let repo = git2::Repository::init_opts(
|
||||||
|
path,
|
||||||
|
git2::RepositoryInitOptions::new().external_template(false),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
let user_name = "anonymous";
|
let user_name = "anonymous";
|
||||||
let user_email = "anonymous@radicle.xyz";
|
let user_email = "anonymous@radicle.xyz";
|
||||||
{
|
{
|
||||||
|
|
@ -209,7 +213,11 @@ pub mod gen {
|
||||||
|
|
||||||
/// Creates a regular repository at the given path with a couple of commits.
|
/// Creates a regular repository at the given path with a couple of commits.
|
||||||
pub fn repository<P: AsRef<Path>>(path: P) -> (git2::Repository, git2::Oid) {
|
pub fn repository<P: AsRef<Path>>(path: P) -> (git2::Repository, git2::Oid) {
|
||||||
let repo = git2::Repository::init(path).unwrap();
|
let repo = git2::Repository::init_opts(
|
||||||
|
path,
|
||||||
|
git2::RepositoryInitOptions::new().external_template(false),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
let sig = git2::Signature::now(string(6).as_str(), email().as_str()).unwrap();
|
let sig = git2::Signature::now(string(6).as_str(), email().as_str()).unwrap();
|
||||||
let head = git::initial_commit(&repo, &sig).unwrap();
|
let head = git::initial_commit(&repo, &sig).unwrap();
|
||||||
let tree =
|
let tree =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue