feat: Update base branch handling to use anyhow

This commit is contained in:
Kiril Videlov 2024-05-24 10:31:43 +02:00
parent f2426fa2a5
commit d5ff348a21

View File

@ -336,9 +336,9 @@ fn _print_tree(repo: &git2::Repository, tree: &git2::Tree) -> Result<()> {
pub fn update_base_branch(
project_repository: &project_repository::Repository,
user: Option<&users::User>,
) -> Result<(), errors::UpdateBaseBranchError> {
) -> anyhow::Result<()> {
if project_repository.is_resolving() {
return Err(errors::UpdateBaseBranchError::Conflict(
anyhow::bail!(errors::UpdateBaseBranchError::Conflict(
errors::ProjectConflict {
project_id: project_repository.project().id,
},