Skip to content

Commit c370ec7

Browse files
author
Hela Bot
committed
Smooth exit if Branch not exists
1 parent 3ed9c3a commit c370ec7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/scans/tools/sast_tool.rs

+3
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@ impl SastTool {
3636
let out = checkout(_path, "/tmp/app", base_branch, branch);
3737
if out.is_err() {
3838
println!("Error while cloning: {}", out.err().unwrap());
39+
std::process::exit(0);
3940
}
4041
} else {
4142
let branch = Some(pr_branch);
4243
let out = checkout(_path, "/tmp/app", None, branch);
4344
if out.is_err() {
4445
println!("Error while cloning: {}", out.err().unwrap());
46+
std::process::exit(0);
4547
}
4648
}
4749
} else {
4850
let out = checkout(_path, "/tmp/app", None, None);
4951
if out.is_err() {
5052
println!("Error while cloning: {}", out.err().unwrap());
53+
std::process::exit(0);
5154
}
5255
}
5356
} else {

src/scans/tools/sca_tool.rs

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ impl ScaTool {
246246
let out = checkout(_path, "/tmp/app", _branch, pr_branch);
247247
if out.is_err() {
248248
println!("Error while cloning: {}", out.err().unwrap());
249+
std::process::exit(0);
249250
}
250251
} else {
251252
if verbose {

src/scans/tools/secret_tool.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ impl SecretTool {
3030
let out = checkout(_path, "/tmp/app", _branch, pr_branch);
3131
if out.is_err() {
3232
println!("Error while cloning: {}", out.err().unwrap());
33+
std::process::exit(0);
3334
}
3435
} else {
3536
if verbose {

0 commit comments

Comments
 (0)