Add git.pullTags setting

This commit is contained in:
Hao Hu 2019-01-30 00:38:25 -08:00 committed by João Moreno
parent 11f4127091
commit 2058f27615
3 changed files with 14 additions and 2 deletions

View file

@ -1272,6 +1272,12 @@
"default": false,
"description": "%config.fetchOnPull%"
},
"git.pullTags": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%config.pullTags%"
},
"git.autoStash": {
"type": "boolean",
"scope": "resource",

View file

@ -112,6 +112,7 @@
"config.rebaseWhenSync": "Force git to use rebase when running the sync command.",
"config.confirmEmptyCommits": "Always confirm the creation of empty commits.",
"config.fetchOnPull": "Fetch all branches when pulling or just the current one.",
"config.pullTags": "Fetch all tags when pulling.",
"config.autoStash": "Stash any changes before pulling and restore them after successful pull.",
"config.allowForcePush": "Controls whether force push (with or without lease) is enabled.",
"config.useForcePushWithLease": "Controls whether force pushing uses the safer force-with-lease variant.",

View file

@ -12,7 +12,7 @@ import { EventEmitter } from 'events';
import iconv = require('iconv-lite');
import * as filetype from 'file-type';
import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util';
import { CancellationToken, Uri } from 'vscode';
import { CancellationToken, Uri, workspace } from 'vscode';
import { detectEncoding } from './encoding';
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git';
@ -1362,7 +1362,12 @@ export class Repository {
}
async pull(rebase?: boolean, remote?: string, branch?: string, options: PullOptions = {}): Promise<void> {
const args = ['pull', '--tags'];
const args = ['pull'];
const config = workspace.getConfiguration('git', Uri.file(this.root));
if (config.get<boolean>('pullTags')) {
args.push('--tags');
}
if (options.unshallow) {
args.push('--unshallow');