fix local branch name serialization

This commit is contained in:
Nikita Galaiko 2023-10-19 10:23:58 +02:00 committed by GitButler
parent 6bb05f8cc9
commit df098e8d57
3 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@ impl Name {
impl Serialize for Name {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(&self.branch)
serializer.serialize_str(&self.to_string())
}
}

View File

@ -339,12 +339,16 @@ pub async fn can_apply_virtual_branch(
pub async fn can_apply_remote_branch(
handle: AppHandle,
project_id: &str,
branch: git::BranchName,
branch: &str,
) -> Result<bool, Error> {
let project_id = project_id.parse().map_err(|_| Error::UserError {
code: Code::Projects,
message: "Malformed project id".to_string(),
})?;
let branch = branch.parse().map_err(|_| Error::UserError {
code: Code::Branches,
message: "Malformed branch name".to_string(),
})?;
handle
.state::<Controller>()
.can_apply_remote_branch(&project_id, &branch)

View File

@ -90,7 +90,6 @@ export class RemoteBranch {
sha!: string;
name!: string;
behind!: number;
upstream?: string;
@Type(() => RemoteCommit)
commits!: RemoteCommit[];
isMergeable!: Promise<boolean>;