refactor: cleanup for #615 (#616)

This commit is contained in:
SteveLauC
2023-11-22 09:34:21 +08:00
committed by GitHub
parent 7e63977ba0
commit b461fc2536
3 changed files with 13 additions and 12 deletions

View File

@@ -153,18 +153,19 @@
[git]
#max_concurrency = 5
# max_concurrency = 5
# Additional git repositories to pull
#repos = [
# "~/src/*/",
# "~/.config/something"
#]
# repos = [
# "~/src/*/",
# "~/.config/something"
# ]
# Don't pull the predefined git repos
# pull_predefined = false
# Arguments to pass Git when pulling Repositories
#arguments = "--rebase --autostash"
# arguments = "--rebase --autostash"
[windows]
# Manually select Windows updates

View File

@@ -839,8 +839,8 @@ impl Config {
}
/// The list of additional git repositories to pull.
pub fn git_repos(&self) -> &Option<Vec<String>> {
get_deprecated_moved_opt!(&self.config_file.misc, git_repos, &self.config_file.git, repos)
pub fn git_repos(&self) -> Option<&Vec<String>> {
self.config_file.git.as_ref().and_then(|git| git.repos.as_ref())
}
/// Tell whether the specified step should run.
@@ -952,8 +952,8 @@ impl Config {
}
/// Extra Git arguments
pub fn git_arguments(&self) -> &Option<String> {
get_deprecated_moved_opt!(&self.config_file.misc, git_arguments, &self.config_file.git, arguments)
pub fn git_arguments(&self) -> Option<&String> {
self.config_file.git.as_ref().and_then(|git| git.arguments.as_ref())
}
/// Extra Tmux arguments

View File

@@ -234,8 +234,8 @@ pub fn run_oh_my_zsh(ctx: &ExecutionContext) -> Result<()> {
custom_repos.insert_if_repo(entry.path());
}
custom_repos.remove_from_pull(&oh_my_zsh.to_string_lossy());
if !custom_repos.pull_is_empty() {
custom_repos.remove(&oh_my_zsh.to_string_lossy());
if !custom_repos.is_empty() {
println!("Pulling custom plugins and themes");
ctx.git().multi_pull(&custom_repos, ctx)?;
}