mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
fixed
This commit is contained in:
parent
8c09d4f476
commit
6dbf6b5857
|
@ -1197,7 +1197,7 @@ export class Repository {
|
|||
}
|
||||
}
|
||||
|
||||
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
|
||||
async pull(rebase?: boolean, remote?: string, branch?: string, cancellationToken?: CancellationToken): Promise<void> {
|
||||
const args = ['pull', '--tags'];
|
||||
|
||||
if (rebase) {
|
||||
|
@ -1210,7 +1210,7 @@ export class Repository {
|
|||
}
|
||||
|
||||
try {
|
||||
await this.run(args);
|
||||
await this.run(args, { cancellationToken });
|
||||
} catch (err) {
|
||||
if (/^CONFLICT \([^)]+\): \b/m.test(err.stdout || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.Conflict;
|
||||
|
|
|
@ -1004,11 +1004,22 @@ export class Repository implements Disposable {
|
|||
await this.run(Operation.Sync, async () => {
|
||||
const config = workspace.getConfiguration('git', Uri.file(this.root));
|
||||
const fetchOnPull = config.get<boolean>('fetchOnPull');
|
||||
const opts = {
|
||||
location: ProgressLocation.Notification,
|
||||
title: localize('sync is unpredictable', "Syncing. Cancelling may cause serious damages to the repository"),
|
||||
cancellable: true
|
||||
};
|
||||
|
||||
if (fetchOnPull) {
|
||||
await this.repository.pull(rebase);
|
||||
await window.withProgress(
|
||||
opts,
|
||||
(_, token) => this.repository.pull(rebase, undefined, undefined, token)
|
||||
);
|
||||
} else {
|
||||
await this.repository.pull(rebase, remoteName, pullBranch);
|
||||
await window.withProgress(
|
||||
opts,
|
||||
(_, token) => this.repository.pull(rebase, remoteName, pullBranch, token)
|
||||
);
|
||||
}
|
||||
|
||||
const remote = this.remotes.find(r => r.name === remoteName);
|
||||
|
|
Loading…
Reference in a new issue