feat: add remote management functionality

- Introduced a new route for adding remotes to git worktrees.
- Enhanced the PushToRemoteDialog component to support adding new remotes, including form handling and error management.
- Updated the API client to include an endpoint for adding remotes.
- Modified the worktree state management to track the presence of remotes.
- Improved the list branches handler to check for configured remotes.

This update allows users to easily add remotes through the UI, enhancing the overall git workflow experience.
This commit is contained in:
Shirone
2026-01-21 22:11:16 +01:00
parent c3cecc18f2
commit a9616ff309
12 changed files with 1142 additions and 95 deletions

View File

@@ -151,7 +151,7 @@ export function useWorktreeDiffs(projectPath: string | undefined, featureId: str
interface BranchInfo {
name: string;
isCurrent: boolean;
isRemote?: boolean;
isRemote: boolean;
lastCommit?: string;
upstream?: string;
}
@@ -161,6 +161,7 @@ interface BranchesResult {
aheadCount: number;
behindCount: number;
hasRemoteBranch: boolean;
hasAnyRemotes: boolean;
isGitRepo: boolean;
hasCommits: boolean;
}
@@ -188,6 +189,7 @@ export function useWorktreeBranches(worktreePath: string | undefined, includeRem
aheadCount: 0,
behindCount: 0,
hasRemoteBranch: false,
hasAnyRemotes: false,
isGitRepo: false,
hasCommits: false,
};
@@ -198,6 +200,7 @@ export function useWorktreeBranches(worktreePath: string | undefined, includeRem
aheadCount: 0,
behindCount: 0,
hasRemoteBranch: false,
hasAnyRemotes: result.result?.hasAnyRemotes ?? false,
isGitRepo: true,
hasCommits: false,
};
@@ -212,6 +215,7 @@ export function useWorktreeBranches(worktreePath: string | undefined, includeRem
aheadCount: result.result?.aheadCount ?? 0,
behindCount: result.result?.behindCount ?? 0,
hasRemoteBranch: result.result?.hasRemoteBranch ?? false,
hasAnyRemotes: result.result?.hasAnyRemotes ?? false,
isGitRepo: true,
hasCommits: true,
};