Skip to content

Commit

Permalink
update param types
Browse files Browse the repository at this point in the history
  • Loading branch information
benluiwj committed Jun 18, 2024
1 parent 7ff0250 commit 85c3afc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions check_diff/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@ struct CliInputs {
/// Parameters:
/// url: git clone url
/// dest: directory where the repo should be cloned
fn clone_git_repo(url: &str, dest: &str) {
pub fn clone_git_repo(url: &str, dest: &Path) {
env::set_var("GIT_TERMINAL_PROMPT", "0");
let git_cmd = Command::new("git")
.args(["clone", "--quiet", url, "--depth", "1", dest])
.args([
"clone",
"--quiet",
url,
"--depth",
"1",
dest.to_str().unwrap(),
])
.output()
.expect("failed to clone repository");
// if the git command does not return successfully,
Expand All @@ -50,6 +57,4 @@ fn clone_git_repo(url: &str, dest: &str) {

fn main() {
let _args = CliInputs::parse();
let sample_repo = "https://github.com/rust-lang/rustfmt.git";
clone_git_repo(sample_repo, "./tmp/");
}

0 comments on commit 85c3afc

Please sign in to comment.