diff options
author | Justin Worthe <justin@jemstep.com> | 2020-03-26 09:14:10 +0200 |
---|---|---|
committer | Justin Worthe <justin@jemstep.com> | 2020-03-26 09:14:10 +0200 |
commit | 82f53b21a27d7742170a24c19a08f9f1d66d0cc2 (patch) | |
tree | 94e91c76e687f513d0eef1fc52d61b284e250e44 | |
parent | 23a1c1cf6b2b9ecb28e1983f9b79e156a5a6a787 (diff) |
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.
-rw-r--r-- | src/git.rs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)?, }); } }; |