Rename RemoteBranch -> Branch

This commit is contained in:
Caleb Owens 2024-07-16 11:58:45 +02:00
parent 43cfc39fbe
commit 4d5ff2f888
No known key found for this signature in database
6 changed files with 15 additions and 15 deletions

View File

@ -10,10 +10,10 @@
import { BranchController } from '$lib/vbranches/branchController';
import type { BaseBranch } from '$lib/baseBranch/baseBranch';
import type { PullRequest } from '$lib/gitHost/interface/types';
import type { RemoteBranch } from '$lib/vbranches/types';
import type { Branch } from '$lib/vbranches/types';
import { goto } from '$app/navigation';
export let branch: RemoteBranch;
export let branch: Branch;
export let base: BaseBranch | undefined | null;
export let pr: PullRequest | undefined;

View File

@ -4,7 +4,7 @@ import { derived, readable, writable, type Readable } from 'svelte/store';
import type { GitHostListingService } from '$lib/gitHost/interface/gitHostListingService';
import type { PullRequest } from '$lib/gitHost/interface/types';
import type { RemoteBranchService } from '$lib/stores/remoteBranches';
import type { VirtualBranch, RemoteBranch } from '$lib/vbranches/types';
import type { VirtualBranch, Branch } from '$lib/vbranches/types';
import type { VirtualBranchService } from '$lib/vbranches/virtualBranch';
export const [getBranchServiceStore, createBranchServiceStore] = buildContextStore<
@ -36,7 +36,7 @@ export class BranchService {
function mergeBranchesAndPrs(
vbranches: VirtualBranch[] | undefined,
pullRequests: PullRequest[] | undefined,
remoteBranches: RemoteBranch[] | undefined
remoteBranches: Branch[] | undefined
): CombinedBranch[] {
const contributions: CombinedBranch[] = [];

View File

@ -1,9 +1,9 @@
import type { PullRequest } from '$lib/gitHost/interface/types';
import type { Author, VirtualBranch, RemoteBranch } from '$lib/vbranches/types';
import type { Author, VirtualBranch, Branch } from '$lib/vbranches/types';
export class CombinedBranch {
pr?: PullRequest;
remoteBranch?: RemoteBranch;
remoteBranch?: Branch;
vbranch?: VirtualBranch;
constructor({
@ -12,7 +12,7 @@ export class CombinedBranch {
pr
}: {
vbranch?: VirtualBranch;
remoteBranch?: RemoteBranch;
remoteBranch?: Branch;
pr?: PullRequest;
}) {
this.vbranch = vbranch;

View File

@ -10,14 +10,14 @@
import { RemoteBranchService } from '$lib/stores/remoteBranches';
import { getContext, getContextStore, getContextStoreBySymbol } from '$lib/utils/context';
import { FileIdSelection } from '$lib/vbranches/fileIdSelection';
import { type RemoteBranch } from '$lib/vbranches/types';
import { type Branch } from '$lib/vbranches/types';
import lscache from 'lscache';
import { marked } from 'marked';
import { onMount, setContext } from 'svelte';
import { writable } from 'svelte/store';
import type { PullRequest } from '$lib/gitHost/interface/types';
export let branch: RemoteBranch;
export let branch: Branch;
export let pr: PullRequest | undefined;
const project = getContext(Project);

View File

@ -1,11 +1,11 @@
import { invoke } from '$lib/backend/ipc';
import { RemoteBranch, RemoteBranchData } from '$lib/vbranches/types';
import { Branch, RemoteBranchData } from '$lib/vbranches/types';
import { plainToInstance } from 'class-transformer';
import { writable } from 'svelte/store';
import type { ProjectMetrics } from '$lib/metrics/projectMetrics';
export class RemoteBranchService {
readonly branches = writable<RemoteBranch[]>([], () => {
readonly branches = writable<Branch[]>([], () => {
this.refresh();
});
error = writable();
@ -18,7 +18,7 @@ export class RemoteBranchService {
async refresh() {
try {
const remoteBranches = plainToInstance(
RemoteBranch,
Branch,
await invoke<any[]>('list_remote_branches', { projectId: this.projectId })
);
this.projectMetrics?.setMetric('normal_branch_count', remoteBranches.length);

View File

@ -109,8 +109,8 @@ export class VirtualBranch {
description!: string;
head!: string;
order!: number;
@Type(() => RemoteBranch)
upstream?: RemoteBranch;
@Type(() => Branch)
upstream?: Branch;
upstreamData?: RemoteBranchData;
upstreamName?: string;
conflicted!: boolean;
@ -324,7 +324,7 @@ export interface Author {
isBot?: boolean;
}
export class RemoteBranch {
export class Branch {
sha!: string;
name!: string;
upstream?: string;