Skip to content

Commit

Permalink
feat(git): clone git repositories without blobs
Browse files Browse the repository at this point in the history
Using `--filter=blob:none` still clones tags,
but avoids downloading blobs until they are needed,
e.g. until particular revision of the repository is checked out.

Cloning all blobs including large deleted files
may take a lot of space for some repositories.
  • Loading branch information
link2xt authored and paolobarbolini committed Apr 2, 2024
1 parent 4790baf commit 1488ddb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ fn main() -> Result<()> {
println!("Cloning {}", repository);
let out = Command::new("git")
.arg("clone")
.arg("--filter=blob:none")
.arg("--")
.arg(repository.to_string())
.arg(&repo_dir)
.env("GIT_TERMINAL_PROMPT", "0")
Expand Down

0 comments on commit 1488ddb

Please sign in to comment.