dugite-extra
Advanced tools
Comparing version 0.0.1-alpha.12 to 0.0.1-alpha.13
@@ -9,2 +9,5 @@ import { IPullProgress } from '../progress'; | ||
* | ||
* @param branch - The name of the branch to pull from. It is required when pulling from a remote which is | ||
* not the default remote tracking of the currently active branch. | ||
* | ||
* @param progressCallback - An optional function which will be invoked | ||
@@ -16,2 +19,2 @@ * with information about the current progress | ||
*/ | ||
export declare function pull(repositoryPath: string, remote: string, progressCallback?: (progress: IPullProgress) => void): Promise<void>; | ||
export declare function pull(repositoryPath: string, remote: string, branch?: string, progressCallback?: (progress: IPullProgress) => void): Promise<void>; |
@@ -47,2 +47,5 @@ "use strict"; | ||
* | ||
* @param branch - The name of the branch to pull from. It is required when pulling from a remote which is | ||
* not the default remote tracking of the currently active branch. | ||
* | ||
* @param progressCallback - An optional function which will be invoked | ||
@@ -54,3 +57,3 @@ * with information about the current progress | ||
*/ | ||
function pull(repositoryPath, remote, progressCallback) { | ||
function pull(repositoryPath, remote, branch, progressCallback) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -82,5 +85,9 @@ var opts, title_1, kind_1, args, result; | ||
} | ||
args = progressCallback | ||
? ['pull', '--progress', remote] | ||
: ['pull', remote]; | ||
args = ['pull', remote]; | ||
if (branch) { | ||
args.push(branch); | ||
} | ||
if (progressCallback) { | ||
args.push('--progress'); | ||
} | ||
return [4 /*yield*/, git_1.git(args, repositoryPath, 'pull', opts)]; | ||
@@ -87,0 +94,0 @@ case 1: |
{ | ||
"name": "dugite-extra", | ||
"version": "0.0.1-alpha.12", | ||
"version": "0.0.1-alpha.13", | ||
"description": "High-level Git commands for dugite.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
# dugite-extra | ||
[![Build Status](https://travis-ci.org/TypeFox/dugite-extra.svg?branch=master)](https://travis-ci.org/TypeFox/dugite-extra) | ||
[![Build Status](https://travis-ci.org/theia-ide/dugite-extra.svg?branch=master)](https://travis-ci.org/theia-ide/dugite-extra) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/9vpa16w198s9qw12/branch/master?svg=true)](https://ci.appveyor.com/project/kittaakos/dugite-extra/branch/master) | ||
@@ -4,0 +4,0 @@ |
@@ -12,2 +12,5 @@ import { git, GitError, IGitExecutionOptions } from '../core/git'; | ||
* | ||
* @param branch - The name of the branch to pull from. It is required when pulling from a remote which is | ||
* not the default remote tracking of the currently active branch. | ||
* | ||
* @param progressCallback - An optional function which will be invoked | ||
@@ -19,3 +22,3 @@ * with information about the current progress | ||
*/ | ||
export async function pull(repositoryPath: string, remote: string, progressCallback?: (progress: IPullProgress) => void): Promise<void> { | ||
export async function pull(repositoryPath: string, remote: string, branch?: string, progressCallback?: (progress: IPullProgress) => void): Promise<void> { | ||
let opts: IGitExecutionOptions = {}; | ||
@@ -50,6 +53,12 @@ if (progressCallback) { | ||
const args = progressCallback | ||
? ['pull', '--progress', remote] | ||
: ['pull', remote]; | ||
const args = ['pull', remote]; | ||
if (branch) { | ||
args.push(branch) | ||
} | ||
if (progressCallback) { | ||
args.push('--progress'); | ||
} | ||
const result = await git(args, repositoryPath, 'pull', opts); | ||
@@ -56,0 +65,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
586408
10545