catch the error returned by add_repo_status

If add_repo_status returns an error it will eventually be printed to the
user but there won't be any repository information:

    [✘] Error getting status: No branch checked out

Catch the error earlier so we can print the repository name:

    [✘] Error: freebsd-src: Couldn't add repo status: No branch checked out
This commit is contained in:
Vincent Rischmann
2022-09-22 21:10:14 +02:00
parent a08a8d2000
commit 061265bbd0

View File

@@ -185,7 +185,11 @@ pub fn get_status_table(config: config::Config) -> Result<(Vec<Table>, Vec<Strin
}
};
add_repo_status(&mut table, &repo.name, &repo_handle, repo.worktree_setup)?;
if let Err(err) =
add_repo_status(&mut table, &repo.name, &repo_handle, repo.worktree_setup)
{
errors.push(format!("{}: Couldn't add repo status: {}", &repo.name, err));
}
}
tables.push(table);