Skip to content

Commit 0c5d45f

Browse files
committed
fix(git): invalidate busy-state on git events; watch rebase/merge files
Without this, aborting/finishing a rebase or merge from outside the app leaves the branch selector showing a stale "Rebasing" label until the next 30s poll. Generated-By: PostHog Code Task-Id: c5674c04-c95c-4bfe-bfcf-248a921b4aae
1 parent 899a337 commit 0c5d45f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/code/src/main/services/file-watcher/service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ export class FileWatcherService extends TypedEventEmitter<FileWatcherEvents> {
214214
(e) =>
215215
e.path.endsWith("/HEAD") ||
216216
e.path.endsWith("/index") ||
217+
e.path.endsWith("/MERGE_HEAD") ||
218+
e.path.endsWith("/CHERRY_PICK_HEAD") ||
219+
e.path.endsWith("/REVERT_HEAD") ||
220+
e.path.includes("/rebase-merge") ||
221+
e.path.includes("/rebase-apply") ||
217222
e.path.includes("/refs/heads/"),
218223
);
219224
if (isRelevant) {

apps/code/src/renderer/features/git-interaction/utils/gitCacheKeys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function invalidateGitBranchQueries(repoPath: string) {
1515
const input = { directoryPath: repoPath };
1616
queryClient.invalidateQueries(trpc.git.getCurrentBranch.queryFilter(input));
1717
queryClient.invalidateQueries(trpc.git.getAllBranches.queryFilter(input));
18+
queryClient.invalidateQueries(trpc.git.getGitBusyState.queryFilter(input));
1819
queryClient.invalidateQueries(trpc.git.getGitSyncStatus.queryFilter(input));
1920
queryClient.invalidateQueries(
2021
trpc.git.getChangedFilesHead.queryFilter(input),

0 commit comments

Comments
 (0)