mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 10:43:08 +00:00
feat: Add git log parsing and rebase endpoint with input validation
This commit is contained in:
@@ -158,16 +158,28 @@ export function usePushWorktree() {
|
||||
/**
|
||||
* Pull changes from remote
|
||||
*
|
||||
* Enhanced to support stash management. When stashIfNeeded is true,
|
||||
* local changes will be automatically stashed before pulling and
|
||||
* reapplied afterward.
|
||||
*
|
||||
* @returns Mutation for pulling changes
|
||||
*/
|
||||
export function usePullWorktree() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ worktreePath, remote }: { worktreePath: string; remote?: string }) => {
|
||||
mutationFn: async ({
|
||||
worktreePath,
|
||||
remote,
|
||||
stashIfNeeded,
|
||||
}: {
|
||||
worktreePath: string;
|
||||
remote?: string;
|
||||
stashIfNeeded?: boolean;
|
||||
}) => {
|
||||
const api = getElectronAPI();
|
||||
if (!api.worktree) throw new Error('Worktree API not available');
|
||||
const result = await api.worktree.pull(worktreePath, remote);
|
||||
const result = await api.worktree.pull(worktreePath, remote, stashIfNeeded);
|
||||
if (!result.success) {
|
||||
throw new Error(result.error || 'Failed to pull changes');
|
||||
}
|
||||
|
||||
@@ -210,18 +210,14 @@ export function useProviderAuthInit() {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
// Only initialize once per session if not already set
|
||||
if (
|
||||
initialized.current ||
|
||||
(claudeAuthStatus !== null &&
|
||||
codexAuthStatus !== null &&
|
||||
zaiAuthStatus !== null &&
|
||||
geminiAuthStatus !== null)
|
||||
) {
|
||||
// Skip if already initialized in this session
|
||||
if (initialized.current) {
|
||||
return;
|
||||
}
|
||||
initialized.current = true;
|
||||
|
||||
// Always call refreshStatuses() to background re-validate on app restart,
|
||||
// even when statuses are pre-populated from persisted storage (cache case).
|
||||
void refreshStatuses();
|
||||
}, [refreshStatuses, claudeAuthStatus, codexAuthStatus, zaiAuthStatus, geminiAuthStatus]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user