From 82f53b21a27d7742170a24c19a08f9f1d66d0cc2 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Thu, 26 Mar 2020 09:14:10 +0200 Subject: Made temp repo cloning a bare clone to save in storage space tmp is often a ramdisk, so this is probably actually often saving in memory usage rather than temporary storage. --- src/git.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/git.rs b/src/git.rs index e69abb9..818d697 100644 --- a/src/git.rs +++ b/src/git.rs @@ -1,7 +1,7 @@ use crate::error::CapnError; use crate::keyring::Keyring; use git2; -use git2::{ErrorClass, ErrorCode, ObjectType, Oid, Repository}; +use git2::{build::RepoBuilder, ErrorClass, ErrorCode, ObjectType, Oid, Repository}; use std::cell::RefCell; use std::collections::HashMap; use std::error::Error; @@ -509,7 +509,9 @@ impl TempRepo { "Path to the repo being verified was not valid UTF-8", )))?; return Ok(TempRepo { - repo: Repository::clone(src_path, &tmp_repo_path)?, + repo: RepoBuilder::new() + .bare(true) + .clone(src_path, &tmp_repo_path)?, }); } }; -- cgit v1.2.3