Skip to content

Commit

Permalink
fix: "refresh" command explicitly refreshes all
Browse files Browse the repository at this point in the history
  • Loading branch information
senyai committed Nov 23, 2024
1 parent b82edc1 commit 1e03f8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import * as humanise from './humanise';
import { partition } from './util';
import { toFossilUri } from './uri';
import { FossilPreviewManager } from './preview';
import type { FossilCWD, FossilExecutable, Reason } from './fossilExecutable';
import type { FossilCWD, FossilExecutable } from './fossilExecutable';

import { localize } from './main';
import type { Credentials } from './gitExport';
Expand Down Expand Up @@ -197,7 +197,7 @@ export class CommandCenter {

@command(Inline.Repository)
async refresh(repository: Repository): Promise<void> {
await repository.status('forced refresh' as Reason);
await repository.refresh();
}

@command()
Expand Down
8 changes: 3 additions & 5 deletions src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,8 @@ export class Repository implements IDisposable, InteractionAPI {
}

@throttle
async status(reason: Reason): Promise<ExecResult> {
const statusPromise = this.repository.getStatus(reason);
await this.runWithProgress({}, () => statusPromise);
this.updateInputBoxPlaceholder();
return statusPromise;
async refresh(): Promise<void> {
await this.runWithProgress(UpdateAll, () => Promise.resolve());
}

private onFSChange(_uri: Uri): void {
Expand Down Expand Up @@ -1068,6 +1065,7 @@ export class Repository implements IDisposable, InteractionAPI {
if (this._currentBranch !== currentBranch) {
this._currentBranch = currentBranch;
}
this.updateInputBoxPlaceholder();
}

private get count(): number {
Expand Down
1 change: 0 additions & 1 deletion src/test/suite/mergeSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export function MergeSuite(this: Suite): void {
await openedRepository.exec(['update', 'trunk']);

await commands.executeCommand('fossil.refresh');
await repository.updateStatus('Test' as Reason); // ToDo: after refresh???
assertGroups(repository, {});

const sqp: sinon.SinonStub = this.ctx.sandbox.stub(
Expand Down

0 comments on commit 1e03f8c

Please sign in to comment.