mirror of
https://github.com/block/buzz.git
synced 2026-11-08 10:21:46 +00:00
feat(desktop): manage project branches (#2212)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type {
|
||||
ProjectLocalRepository,
|
||||
ProjectLocalRepoSnapshot,
|
||||
ProjectRepoBranchResult,
|
||||
ProjectRepoCloneResult,
|
||||
ProjectRepoDiff,
|
||||
ProjectRepoMergeResult,
|
||||
@@ -96,6 +97,12 @@ type RawProjectRepoPullResult = {
|
||||
message: string;
|
||||
};
|
||||
|
||||
type RawProjectRepoBranchResult = {
|
||||
branch: string;
|
||||
commit: string;
|
||||
message: string;
|
||||
};
|
||||
|
||||
type RawProjectRepoDiffFile = {
|
||||
path: string;
|
||||
additions: number;
|
||||
@@ -426,6 +433,38 @@ export async function cloneProjectRepository(input: {
|
||||
});
|
||||
}
|
||||
|
||||
export async function createProjectRemoteBranch(input: {
|
||||
cloneUrl: string;
|
||||
sourceBranch: string;
|
||||
expectedCommit: string;
|
||||
newBranch: string;
|
||||
}): Promise<ProjectRepoBranchResult> {
|
||||
return invokeTauri<RawProjectRepoBranchResult>(
|
||||
"create_project_remote_branch",
|
||||
{
|
||||
cloneUrl: input.cloneUrl,
|
||||
sourceBranch: input.sourceBranch,
|
||||
expectedCommit: input.expectedCommit,
|
||||
newBranch: input.newBranch,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteProjectRemoteBranch(input: {
|
||||
cloneUrl: string;
|
||||
branch: string;
|
||||
expectedCommit: string;
|
||||
}): Promise<ProjectRepoBranchResult> {
|
||||
return invokeTauri<RawProjectRepoBranchResult>(
|
||||
"delete_project_remote_branch",
|
||||
{
|
||||
cloneUrl: input.cloneUrl,
|
||||
branch: input.branch,
|
||||
expectedCommit: input.expectedCommit,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
type RawProjectRepoMergeResult = {
|
||||
message: string;
|
||||
merge_commit: string;
|
||||
|
||||
@@ -93,6 +93,12 @@ export type ProjectRepoCloneResult = {
|
||||
message: string;
|
||||
};
|
||||
|
||||
export type ProjectRepoBranchResult = {
|
||||
branch: string;
|
||||
commit: string;
|
||||
message: string;
|
||||
};
|
||||
|
||||
export type ProjectRepoMergeResult = {
|
||||
message: string;
|
||||
mergeCommit: string;
|
||||
|
||||
@@ -190,6 +190,7 @@ export type UserStatusLookup = Record<string, UserStatus | null>;
|
||||
export type {
|
||||
ProjectLocalRepository,
|
||||
ProjectLocalRepoSnapshot,
|
||||
ProjectRepoBranchResult,
|
||||
ProjectRepoCommit,
|
||||
ProjectRepoContributor,
|
||||
ProjectRepoCloneResult,
|
||||
|
||||
Reference in New Issue
Block a user