mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
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:
@@ -330,7 +330,14 @@ export type {
|
||||
export { EVENT_HISTORY_VERSION, DEFAULT_EVENT_HISTORY_INDEX } from './event-history.js';
|
||||
|
||||
// Worktree and PR types
|
||||
export type { PRState, WorktreePRInfo } from './worktree.js';
|
||||
export type {
|
||||
PRState,
|
||||
WorktreePRInfo,
|
||||
AddRemoteRequest,
|
||||
AddRemoteResult,
|
||||
AddRemoteResponse,
|
||||
AddRemoteErrorResponse,
|
||||
} from './worktree.js';
|
||||
export { PR_STATES, validatePRState } from './worktree.js';
|
||||
|
||||
// Terminal types
|
||||
|
||||
@@ -30,3 +30,47 @@ export interface WorktreePRInfo {
|
||||
state: PRState;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request payload for adding a git remote
|
||||
*/
|
||||
export interface AddRemoteRequest {
|
||||
/** Path to the git worktree/repository */
|
||||
worktreePath: string;
|
||||
/** Name for the remote (e.g., 'origin', 'upstream') */
|
||||
remoteName: string;
|
||||
/** URL of the remote repository (HTTPS, SSH, or git:// protocol) */
|
||||
remoteUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Result data from a successful add-remote operation
|
||||
*/
|
||||
export interface AddRemoteResult {
|
||||
/** Name of the added remote */
|
||||
remoteName: string;
|
||||
/** URL of the added remote */
|
||||
remoteUrl: string;
|
||||
/** Whether the initial fetch was successful */
|
||||
fetched: boolean;
|
||||
/** Human-readable status message */
|
||||
message: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Successful response from add-remote endpoint
|
||||
*/
|
||||
export interface AddRemoteResponse {
|
||||
success: true;
|
||||
result: AddRemoteResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error response from add-remote endpoint
|
||||
*/
|
||||
export interface AddRemoteErrorResponse {
|
||||
success: false;
|
||||
error: string;
|
||||
/** Optional error code for specific error types (e.g., 'REMOTE_EXISTS') */
|
||||
code?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user