Keep Git status and diffs current across platforms (#2775)

* fix(server): make Git observation cross-platform

Platform-specific watchers and forced full refreshes amplified Git processes and could miss nested changes. Share checkout and repository observation internally, scope final-state refreshes, and bound degraded polling so streamed summaries and diffs stay correct under bursts.

* fix(server): refresh Git worktree state on metadata changes

* fix(server): keep Git watcher runtime inputs current

* fix(server): normalize watcher runtime boundaries

* fix(server): reconcile Git observer topology

* test(server): report Git watcher event batches

* fix(server): close Git observation gaps

* chore(ci): remove temporary Git observation jobs
This commit is contained in:
Mohamed Boudra
2026-08-02 12:20:20 +02:00
committed by GitHub
parent f888bae04d
commit 0a106dd35f
16 changed files with 3558 additions and 631 deletions
+16
View File
@@ -2664,6 +2664,22 @@ export async function getCheckoutShortstat(
return getOrLoadCheckoutShortstat(cwd, context, options);
}
export interface CheckoutWorktreeState {
isDirty: boolean;
diffStat: CheckoutShortstat | null;
}
export async function getCheckoutWorktreeState(
cwd: string,
context: CheckoutContext,
): Promise<CheckoutWorktreeState> {
const [isDirty, diffStat] = await Promise.all([
isWorkingTreeDirty(cwd, context),
getCheckoutShortstat(cwd, context, { force: true }),
]);
return { isDirty, diffStat };
}
export function getCachedCheckoutShortstat(cwd: string): CheckoutShortstat | null | undefined {
return shortstatCache.get(getShortstatCacheKey(cwd));
}