diff --git a/extensions/git/package.json b/extensions/git/package.json index f64859e19db..26f675b4013 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1051,6 +1051,12 @@ "description": "%config.showProgress%", "default": true, "scope": "resource" + }, + "git.syncRebase": { + "type": "boolean", + "scope": "resource", + "default": false, + "description": "%config.syncRebase%" } } }, diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index dc89bb2a9d8..6e6b923fb02 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -88,6 +88,7 @@ "config.alwaysSignOff": "Controls the signoff flag for all commits.", "config.ignoredRepositories": "List of git repositories to ignore.", "config.showProgress": "Controls whether git actions should show progress.", + "config.syncRebase": "Synchronize changes using rebase.", "colors.modified": "Color for modified resources.", "colors.deleted": "Color for deleted resources.", "colors.untracked": "Color for untracked resources.", diff --git a/extensions/git/src/statusbar.ts b/extensions/git/src/statusbar.ts index 8cabe51c016..37b9f553acc 100644 --- a/extensions/git/src/statusbar.ts +++ b/extensions/git/src/statusbar.ts @@ -5,7 +5,7 @@ 'use strict'; -import { Disposable, Command, EventEmitter, Event } from 'vscode'; +import { Disposable, Command, EventEmitter, Event, workspace } from 'vscode'; import { Repository, Operation } from './repository'; import { anyEvent, dispose } from './util'; import * as nls from 'vscode-nls'; @@ -100,10 +100,18 @@ class SyncStatusBar { if (HEAD && HEAD.name && HEAD.commit) { if (HEAD.upstream) { + const config = workspace.getConfiguration('git'); + const gitSyncRebase = config.get('syncRebase'); + if (HEAD.ahead || HEAD.behind) { text += this.repository.syncLabel; } - command = 'git.sync'; + + if (gitSyncRebase) { + command = 'git.syncRebase'; + } else { + command = 'git.sync'; + } tooltip = localize('sync changes', "Synchronize Changes"); } else { icon = '$(cloud-upload)';