Skip to content

Commit 8f1cceb

Browse files
committed
lintcheck: print warnings if we can't check out or clone a git repo
1 parent f8dbcae commit 8f1cceb

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

clippy_dev/src/lintcheck.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,28 @@ impl CrateSource {
125125
// clone the repo if we have not done so
126126
if !repo_path.is_dir() {
127127
println!("Cloning {} and checking out {}", url, commit);
128-
Command::new("git")
128+
if !Command::new("git")
129129
.arg("clone")
130130
.arg(url)
131131
.arg(&repo_path)
132-
.output()
133-
.expect("Failed to clone git repo!");
132+
.status()
133+
.expect("Failed to clone git repo!")
134+
.success()
135+
{
136+
eprintln!("Failed to clone {} into {}", url, repo_path.display())
137+
}
134138
}
135139
// check out the commit/branch/whatever
136-
Command::new("git")
140+
if !Command::new("git")
137141
.arg("checkout")
138142
.arg(commit)
139143
.current_dir(&repo_path)
140-
.output()
141-
.expect("Failed to check out commit");
144+
.status()
145+
.expect("Failed to check out commit")
146+
.success()
147+
{
148+
eprintln!("Failed to checkout {} of repo at {}", commit, repo_path.display())
149+
}
142150

143151
Crate {
144152
version: commit.clone(),

0 commit comments

Comments
 (0)