mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
Merge pull request #540 from stefandevo/fix/gh-not-in-git-folder
fix: stop repeated GitHub PR fetch warnings for non-GitHub repos
This commit is contained in:
@@ -39,7 +39,10 @@ export function useWorktrees({
|
||||
logger.warn('Worktree API not available');
|
||||
return;
|
||||
}
|
||||
const result = await api.worktree.listAll(projectPath, true);
|
||||
// Pass forceRefreshGitHub when this is a manual refresh (not silent polling)
|
||||
// This clears the GitHub remote cache so users can re-detect after adding a remote
|
||||
const forceRefreshGitHub = !silent;
|
||||
const result = await api.worktree.listAll(projectPath, true, forceRefreshGitHub);
|
||||
if (result.success && result.worktrees) {
|
||||
setWorktrees(result.worktrees);
|
||||
setWorktreesInStore(projectPath, result.worktrees);
|
||||
|
||||
@@ -1596,10 +1596,15 @@ function createMockWorktreeAPI(): WorktreeAPI {
|
||||
return { success: true, worktrees: [] };
|
||||
},
|
||||
|
||||
listAll: async (projectPath: string, includeDetails?: boolean) => {
|
||||
listAll: async (
|
||||
projectPath: string,
|
||||
includeDetails?: boolean,
|
||||
forceRefreshGitHub?: boolean
|
||||
) => {
|
||||
console.log('[Mock] Listing all worktrees:', {
|
||||
projectPath,
|
||||
includeDetails,
|
||||
forceRefreshGitHub,
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -1724,8 +1724,8 @@ export class HttpApiClient implements ElectronAPI {
|
||||
getStatus: (projectPath: string, featureId: string) =>
|
||||
this.post('/api/worktree/status', { projectPath, featureId }),
|
||||
list: (projectPath: string) => this.post('/api/worktree/list', { projectPath }),
|
||||
listAll: (projectPath: string, includeDetails?: boolean) =>
|
||||
this.post('/api/worktree/list', { projectPath, includeDetails }),
|
||||
listAll: (projectPath: string, includeDetails?: boolean, forceRefreshGitHub?: boolean) =>
|
||||
this.post('/api/worktree/list', { projectPath, includeDetails, forceRefreshGitHub }),
|
||||
create: (projectPath: string, branchName: string, baseBranch?: string) =>
|
||||
this.post('/api/worktree/create', {
|
||||
projectPath,
|
||||
|
||||
3
apps/ui/src/types/electron.d.ts
vendored
3
apps/ui/src/types/electron.d.ts
vendored
@@ -705,7 +705,8 @@ export interface WorktreeAPI {
|
||||
// List all worktrees with details (for worktree selector)
|
||||
listAll: (
|
||||
projectPath: string,
|
||||
includeDetails?: boolean
|
||||
includeDetails?: boolean,
|
||||
forceRefreshGitHub?: boolean
|
||||
) => Promise<{
|
||||
success: boolean;
|
||||
worktrees?: Array<{
|
||||
|
||||
Reference in New Issue
Block a user