Merge pull request #1464 from gitbutlerapp/handle-missing-default-target

🔧 fix: handle case when default target is not set
This commit is contained in:
Nikita Galaiko 2023-10-30 10:11:08 +02:00 committed by GitHub
commit b896c34b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,12 @@ impl HandlerInner {
user.as_ref(),
)
.context("failed to open repository")?;
let default_target = gb_repo.default_target()?.context("target not set")?;
let default_target = if let Some(target) = gb_repo.default_target()? {
target
} else {
return Ok(vec![]);
};
let credentials = git::credentials::Factory::new(
&project,