提交 df3af972 编写于 作者: A Asif Hasan

fix fetchOnPull behavior for Sync

上级 fc797d24
......@@ -1513,9 +1513,11 @@ export class Repository {
await this.run(args);
}
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean } = {}): Promise<void> {
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean, readonly cancellationToken?: CancellationToken } = {}): Promise<void> {
const args = ['fetch'];
const spawnOptions: SpawnOptions = {};
const spawnOptions: SpawnOptions = {
cancellationToken: options.cancellationToken,
};
if (options.remote) {
args.push(options.remote);
......
......@@ -1225,9 +1225,16 @@ export class Repository implements Disposable {
const tags = config.get<boolean>('pullTags');
const supportCancellation = config.get<boolean>('supportCancellation');
const fn = fetchOnPull
? async (cancellationToken?: CancellationToken) => await this.repository.pull(rebase, undefined, undefined, { tags, cancellationToken })
: async (cancellationToken?: CancellationToken) => await this.repository.pull(rebase, remoteName, pullBranch, { tags, cancellationToken });
const fn = async (cancellationToken?: CancellationToken) => {
// When fetchOnPull is enabled, fetch all branches when pulling
if (fetchOnPull) {
await this.repository.fetch({ all: true, cancellationToken });
}
await this.repository.pull(rebase, remoteName, pullBranch, { tags, cancellationToken });
};
if (supportCancellation) {
const opts: ProgressOptions = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册