Fix dependency audit findings
Some checks failed
Weekly OSV dependency audit / dependency-audit (push) Failing after 4s
Some checks failed
Weekly OSV dependency audit / dependency-audit (push) Failing after 4s
This commit is contained in:
@@ -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}"))?;
|
||||
|
||||
Reference in New Issue
Block a user