Skip to content

Commit 0f1326d

Browse files
committed
Remove .git directory when downloading a crate from git(hub)
1 parent e2ec11a commit 0f1326d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

collector/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ fn download_from_git(target: &Path, url: &str) -> anyhow::Result<()> {
12521252
.status()
12531253
.expect("Git clone failed");
12541254
generate_lockfile(tmpdir.path());
1255+
1256+
std::fs::remove_dir_all(tmpdir.path().join(".git")).expect("Could not delete .git directory");
1257+
12551258
execute::rename(&tmpdir, &target)?;
12561259
Ok(())
12571260
}

0 commit comments

Comments
 (0)