提交 417cdb62 编写于 作者: J Joao Moreno

git.pullFrom

octopus commit
......@@ -193,8 +193,8 @@
"category": "Git"
},
{
"command": "git.pullFromRemoteBranch",
"title": "%command.pullFromRemoteBranch%",
"command": "git.pullFrom",
"title": "%command.pullFrom%",
"category": "Git"
},
{
......@@ -327,13 +327,17 @@
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.pullFromRemoteBranch",
"command": "git.pullFrom",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.pullRebase",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.pullFrom",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.push",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
......@@ -387,8 +391,7 @@
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.pullFromRemoteBranch",
"group": "1_sync",
"command": "git.pullFrom",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
......
......@@ -25,7 +25,7 @@
"command.merge": "Merge Branch...",
"command.pull": "Pull",
"command.pullRebase": "Pull (Rebase)",
"command.pullFromRemoteBranch": "Pull From...",
"command.pullFrom": "Pull from...",
"command.push": "Push",
"command.pushTo": "Push to...",
"command.sync": "Sync",
......
......@@ -810,7 +810,7 @@ export class CommandCenter {
}
}
@command('git.pullFromRemoteBranch')
@command('git.pullFrom')
async pullFrom(): Promise<void> {
const remotes = this.model.remotes;
......
......@@ -751,19 +751,16 @@ export class Repository {
}
}
async pull(rebase?: boolean, remote?: string, name?: string): Promise<void> {
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
const args = ['pull'];
if (rebase) {
args.push('-r');
}
if (remote) {
if (remote && branch) {
args.push(remote);
}
if (name) {
args.push(name);
args.push(branch);
}
try {
......
......@@ -501,6 +501,10 @@ export class Model implements Disposable {
await this.run(Operation.Push, () => this.repository.push());
}
async pullFrom(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
await this.run(Operation.Pull, () => this.repository.pull(rebase, remote, branch));
}
async pushTo(remote?: string, name?: string, setUpstream: boolean = false): Promise<void> {
await this.run(Operation.Push, () => this.repository.push(remote, name, setUpstream));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册