Fix dependency audit findings
Some checks failed
Weekly OSV dependency audit / dependency-audit (push) Failing after 4s

This commit is contained in:
Georg Bauer
2026-08-09 16:41:00 +02:00
parent 39ee904b3b
commit 02022f4fca
4 changed files with 44 additions and 1651 deletions

View File

@@ -407,10 +407,12 @@ fn git_switch(path: &Path, branch: &str) -> Result<(), String> {
let repository = git2::Repository::discover(path)
.map_err(|error| format!("Could not switch Git branches: {error}"))?;
let reference = format!("refs/heads/{branch}");
let previous = repository
.find_reference("HEAD")
.ok()
.map(|head| (head.symbolic_target().map(str::to_owned), head.target()));
let previous = repository.find_reference("HEAD").ok().map(|head| {
(
head.symbolic_target().ok().flatten().map(str::to_owned),
head.target(),
)
});
repository
.set_head(&reference)
.map_err(|error| format!("Could not switch Git branches: {error}"))?;