fix: shellexpand git.pull_only_repos & git.push_only_repos (#576)

This commit is contained in:
SteveLauC
2023-10-13 18:54:42 +08:00
committed by GitHub
parent fe9d877cdf
commit 1b5fdb6645

View File

@@ -697,6 +697,22 @@ impl ConfigFile {
}
}
if let Some(paths) = result.git.as_mut().and_then(|git| git.pull_only_repos.as_mut()) {
for path in paths.iter_mut() {
let expanded = shellexpand::tilde::<&str>(&path.as_ref()).into_owned();
debug!("Path {} expanded to {}", path, expanded);
*path = expanded;
}
}
if let Some(paths) = result.git.as_mut().and_then(|git| git.push_only_repos.as_mut()) {
for path in paths.iter_mut() {
let expanded = shellexpand::tilde::<&str>(&path.as_ref()).into_owned();
debug!("Path {} expanded to {}", path, expanded);
*path = expanded;
}
}
debug!("Loaded configuration: {:?}", result);
Ok(result)