Socket
Socket
Sign inDemoInstall

dugite-extra

Package Overview
Dependencies
79
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.14 to 0.1.15

0

lib/command/apply.d.ts
import { IGitExecutionOptions } from '../core/git';
import { WorkingDirectoryFileChange } from '../model/status';
export declare function applyPatchToIndex(repositoryPath: string, file: WorkingDirectoryFileChange, options?: IGitExecutionOptions): Promise<void>;

18

lib/command/apply.js

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -66,2 +67,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.applyPatchToIndex = void 0;
var git_1 = require("../core/git");

@@ -86,3 +88,3 @@ var status_1 = require("../model/status");

// by updateIndex.
return [4 /*yield*/, git_1.git(['add', '--u', '--', file.oldPath], repositoryPath, 'applyPatchToIndex')];
return [4 /*yield*/, (0, git_1.git)(['add', '--u', '--', file.oldPath], repositoryPath, 'applyPatchToIndex')];
case 1:

@@ -97,3 +99,3 @@ // Make sure the index knows of the removed file. We could use

_c.sent();
return [4 /*yield*/, git_1.git(['ls-tree', 'HEAD', '--', file.oldPath], repositoryPath, 'applyPatchToIndex')];
return [4 /*yield*/, (0, git_1.git)(['ls-tree', 'HEAD', '--', file.oldPath], repositoryPath, 'applyPatchToIndex')];
case 2:

@@ -104,3 +106,3 @@ oldFile = _c.sent();

// Add the old file blob to the index under the new name
return [4 /*yield*/, git_1.git(['update-index', '--add', '--cacheinfo', mode, oid, file.path], repositoryPath, 'applyPatchToIndex', options)];
return [4 /*yield*/, (0, git_1.git)(['update-index', '--add', '--cacheinfo', mode, oid, file.path], repositoryPath, 'applyPatchToIndex', options)];
case 3:

@@ -112,3 +114,3 @@ // Add the old file blob to the index under the new name

applyArgs = ['apply', '--cached', '--unidiff-zero', '--whitespace=nowarn', '-'];
return [4 /*yield*/, diff_2.getWorkingDirectoryDiff(repositoryPath, file)];
return [4 /*yield*/, (0, diff_2.getWorkingDirectoryDiff)(repositoryPath, file)];
case 5:

@@ -123,7 +125,7 @@ diff = _c.sent();

}
return [4 /*yield*/, patch_formatter_1.formatPatch(file, diff)];
return [4 /*yield*/, (0, patch_formatter_1.formatPatch)(file, diff)];
case 6:
patch = _c.sent();
opts = __assign({}, opts, { stdin: patch });
return [4 /*yield*/, git_1.git(applyArgs, repositoryPath, 'applyPatchToIndex', opts)];
opts = __assign(__assign({}, opts), { stdin: patch });
return [4 /*yield*/, (0, git_1.git)(applyArgs, repositoryPath, 'applyPatchToIndex', opts)];
case 7:

@@ -130,0 +132,0 @@ _c.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -65,7 +66,13 @@ });

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteBranch = exports.renameBranch = exports.createBranch = exports.listBranch = void 0;
var git_1 = require("../core/git");

@@ -98,4 +105,4 @@ var branch_1 = require("../model/branch");

}
opts = __assign({}, opts, { successExitCodes: new Set([0, 1, 128]) });
return [4 /*yield*/, git_1.git(['rev-parse', '--abbrev-ref', 'HEAD'], repositoryPath, 'getCurrentBranch', opts)];
opts = __assign(__assign({}, opts), { successExitCodes: new Set([0, 1, 128]) });
return [4 /*yield*/, (0, git_1.git)(['rev-parse', '--abbrev-ref', 'HEAD'], repositoryPath, 'getCurrentBranch', opts)];
case 1:

@@ -140,3 +147,3 @@ result = _a.sent();

}
return [4 /*yield*/, git_1.git(args, repositoryPath, 'createBranch', options)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'createBranch', options)];
case 1:

@@ -158,3 +165,3 @@ _a.sent();

args = ['branch', "" + (force ? '-M' : '-m'), name, newName];
return [4 /*yield*/, git_1.git(args, repositoryPath, 'renameBranch', options)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'renameBranch', options)];
case 1:

@@ -187,3 +194,3 @@ _a.sent();

branches = _a;
return [4 /*yield*/, git_1.git(args, repositoryPath, 'deleteBranch', options)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'deleteBranch', options)];
case 4:

@@ -195,3 +202,3 @@ _b.sent();

// Push the remote deletion.
return [4 /*yield*/, git_1.git(['push', branch.remote, ":" + branch.upstreamWithoutRemote], repositoryPath, 'deleteRemoteBranch', options)];
return [4 /*yield*/, (0, git_1.git)(['push', branch.remote, ":" + branch.upstreamWithoutRemote], repositoryPath, 'deleteRemoteBranch', options)];
case 5:

@@ -216,4 +223,4 @@ // Push the remote deletion.

}
args = __spread(['for-each-ref', "--format=" + forEachRefFormat, '--sort=-committerdate'], prefixes);
return [4 /*yield*/, git_1.git(args, repositoryPath, 'getBranches', options)];
args = __spreadArray(['for-each-ref', "--format=" + forEachRefFormat, '--sort=-committerdate'], __read(prefixes), false);
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'getBranches', options)];
case 1:

@@ -227,3 +234,3 @@ result = _a.sent();

// Preceding newline character after first row.
var pieces = (ix > 0 ? line.substr(1) : line).split('\0');
var pieces = (ix > 0 ? line.substring(1) : line).split('\0');
var ref = pieces[0];

@@ -230,0 +237,0 @@ var name = pieces[1];

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -50,3 +50,3 @@ var temp = require("temp");

var path;
var createAndCommit = function (filename, message) { return __awaiter(_this, void 0, void 0, function () {
var createAndCommit = function (filename, message) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -56,6 +56,6 @@ switch (_a.label) {

fs.createFileSync(Path.join(path, filename));
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 1:
_a.sent();
return [4 /*yield*/, commit_1.createCommit(path, message)];
return [4 /*yield*/, (0, commit_1.createCommit)(path, message)];
case 2:

@@ -67,3 +67,3 @@ _a.sent();

}); };
var getCommitIds = function (repoPath) { return __awaiter(_this, void 0, void 0, function () {
var getCommitIds = function (repoPath) { return __awaiter(void 0, void 0, void 0, function () {
var log, e_1;

@@ -74,3 +74,3 @@ return __generator(this, function (_a) {

_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, git_1.git(['log', '--pretty=%H'], repoPath, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--pretty=%H'], repoPath, 'log')];
case 1:

@@ -93,6 +93,5 @@ log = _a.sent();

}); };
describe('branch', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('branch', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
beforeEach(function () { return __awaiter(_this, void 0, void 0, function () {
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -102,3 +101,3 @@ switch (_a.label) {

path = track.mkdirSync('branch');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:

@@ -113,14 +112,14 @@ _a.sent();

});
it('no branch before first commit', function () { return __awaiter(_this, void 0, void 0, function () {
it('no branch before first commit', function () { return __awaiter(void 0, void 0, void 0, function () {
var localBranches, currentBranch;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, branch_1.listBranch(path, 'all')];
case 0: return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 1:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(0);
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(0);
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 2:
currentBranch = _a.sent();
chai_1.expect(currentBranch).to.be.undefined;
(0, chai_1.expect)(currentBranch).to.be.undefined;
return [2 /*return*/];

@@ -130,3 +129,3 @@ }

}); });
it('only master branch after first commit', function () { return __awaiter(_this, void 0, void 0, function () {
it('only master branch after first commit', function () { return __awaiter(void 0, void 0, void 0, function () {
var localBranches, curretnBranch;

@@ -138,12 +137,12 @@ return __generator(this, function (_a) {

_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 2:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(1);
chai_1.expect(localBranches[0].name).to.be.equal('master');
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(1);
(0, chai_1.expect)(localBranches[0].name).to.be.equal('master');
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 3:
curretnBranch = _a.sent();
chai_1.expect(curretnBranch).to.not.be.undefined;
chai_1.expect(curretnBranch.name).to.be.equal('master');
(0, chai_1.expect)(curretnBranch).to.not.be.undefined;
(0, chai_1.expect)(curretnBranch.name).to.be.equal('master');
return [2 /*return*/];

@@ -153,3 +152,3 @@ }

}); });
it('new branch is selected on creation if checkout is true', function () { return __awaiter(_this, void 0, void 0, function () {
it('new branch is selected on creation if checkout is true', function () { return __awaiter(void 0, void 0, void 0, function () {
var newBranch, localBranches, currentBranch;

@@ -162,16 +161,16 @@ return __generator(this, function (_a) {

newBranch = 'branch1';
return [4 /*yield*/, branch_1.createBranch(path, newBranch, { checkout: true })];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch, { checkout: true })];
case 2:
_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 3:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(2);
chai_1.expect(localBranches[0].name).to.be.equal('master');
chai_1.expect(localBranches[1].name).to.be.equal(newBranch);
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(2);
(0, chai_1.expect)(localBranches[1].name).to.be.equal('master');
(0, chai_1.expect)(localBranches[0].name).to.be.equal(newBranch);
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 4:
currentBranch = _a.sent();
chai_1.expect(currentBranch).to.not.be.undefined;
chai_1.expect(currentBranch.name).to.be.equal(newBranch);
(0, chai_1.expect)(currentBranch).to.not.be.undefined;
(0, chai_1.expect)(currentBranch.name).to.be.equal(newBranch);
return [2 /*return*/];

@@ -181,3 +180,3 @@ }

}); });
it('new branch is not selected on creation if checkout is false', function () { return __awaiter(_this, void 0, void 0, function () {
it('new branch is not selected on creation if checkout is false', function () { return __awaiter(void 0, void 0, void 0, function () {
var newBranch, localBranches, currentBranch;

@@ -190,16 +189,16 @@ return __generator(this, function (_a) {

newBranch = 'branch1';
return [4 /*yield*/, branch_1.createBranch(path, newBranch)];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch)];
case 2:
_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 3:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(2);
chai_1.expect(localBranches[0].name).to.be.equal('master');
chai_1.expect(localBranches[1].name).to.be.equal(newBranch);
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(2);
(0, chai_1.expect)(localBranches[1].name).to.be.equal('master');
(0, chai_1.expect)(localBranches[0].name).to.be.equal(newBranch);
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 4:
currentBranch = _a.sent();
chai_1.expect(currentBranch).to.not.be.undefined;
chai_1.expect(currentBranch.name).to.be.equal('master');
(0, chai_1.expect)(currentBranch).to.not.be.undefined;
(0, chai_1.expect)(currentBranch.name).to.be.equal('master');
return [2 /*return*/];

@@ -209,3 +208,3 @@ }

}); });
it('new branch is not created until first commit', function () { return __awaiter(_this, void 0, void 0, function () {
it('new branch is not created until first commit', function () { return __awaiter(void 0, void 0, void 0, function () {
var newBranch, localBranches;

@@ -216,9 +215,9 @@ return __generator(this, function (_a) {

newBranch = 'branch1';
return [4 /*yield*/, branch_1.createBranch(path, newBranch, { checkout: true })];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch, { checkout: true })];
case 1:
_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 2:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(0);
(0, chai_1.expect)(localBranches.length).to.be.equal(0);
return [2 /*return*/];

@@ -228,3 +227,3 @@ }

}); });
it('new branch is created on first commit in place of master if checkout is true', function () { return __awaiter(_this, void 0, void 0, function () {
it('new branch is created on first commit in place of master if checkout is true', function () { return __awaiter(void 0, void 0, void 0, function () {
var newBranch, localBranches, currentBranch;

@@ -235,3 +234,3 @@ return __generator(this, function (_a) {

newBranch = 'branch1';
return [4 /*yield*/, branch_1.createBranch(path, newBranch, { checkout: true })];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch, { checkout: true })];
case 1:

@@ -242,12 +241,12 @@ _a.sent();

_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 3:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(1);
chai_1.expect(localBranches[0].name).to.be.equal(newBranch);
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(1);
(0, chai_1.expect)(localBranches[0].name).to.be.equal(newBranch);
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 4:
currentBranch = _a.sent();
chai_1.expect(currentBranch).to.not.be.undefined;
chai_1.expect(currentBranch.name).to.be.equal(newBranch);
(0, chai_1.expect)(currentBranch).to.not.be.undefined;
(0, chai_1.expect)(currentBranch.name).to.be.equal(newBranch);
return [2 /*return*/];

@@ -257,3 +256,3 @@ }

}); });
it('a new branch cannot be created before master if checkout is false', function () { return __awaiter(_this, void 0, void 0, function () {
it('a new branch cannot be created before master if checkout is false', function () { return __awaiter(void 0, void 0, void 0, function () {
var newBranch, e_2;

@@ -267,3 +266,3 @@ return __generator(this, function (_a) {

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, branch_1.createBranch(path, newBranch)];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch)];
case 2:

@@ -286,3 +285,3 @@ _a.sent();

}); });
it('new branch is created on correct start point', function () { return __awaiter(_this, void 0, void 0, function () {
it('new branch is created on correct start point', function () { return __awaiter(void 0, void 0, void 0, function () {
var commitIds, firstCommitId, newBranch, localBranches, currentBranch, newCommitIds;

@@ -302,18 +301,18 @@ return __generator(this, function (_a) {

newBranch = 'branch1';
return [4 /*yield*/, branch_1.createBranch(path, newBranch, { startPoint: firstCommitId, checkout: true })];
return [4 /*yield*/, (0, branch_1.createBranch)(path, newBranch, { startPoint: firstCommitId, checkout: true })];
case 4:
_a.sent();
return [4 /*yield*/, branch_1.listBranch(path, 'all')];
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'all')];
case 5:
localBranches = _a.sent();
chai_1.expect(localBranches.length).to.be.equal(2);
return [4 /*yield*/, branch_1.listBranch(path, 'current')];
(0, chai_1.expect)(localBranches.length).to.be.equal(2);
return [4 /*yield*/, (0, branch_1.listBranch)(path, 'current')];
case 6:
currentBranch = _a.sent();
chai_1.expect(currentBranch).to.not.be.undefined;
chai_1.expect(currentBranch.name).to.be.equal(newBranch);
(0, chai_1.expect)(currentBranch).to.not.be.undefined;
(0, chai_1.expect)(currentBranch.name).to.be.equal(newBranch);
return [4 /*yield*/, getCommitIds(path)];
case 7:
newCommitIds = _a.sent();
chai_1.expect(newCommitIds[0]).to.be.equal(firstCommitId);
(0, chai_1.expect)(newCommitIds[0]).to.be.equal(firstCommitId);
return [2 /*return*/];

@@ -320,0 +319,0 @@ }

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -65,7 +66,13 @@ });

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkout = exports.checkoutPaths = exports.checkoutBranch = void 0;
var Path = require("path");

@@ -99,3 +106,3 @@ var git_1 = require("../core/git");

targetBranch_1 = name;
processCallback = progress_1.progressProcessCallback(new progress_1.CheckoutProgressParser(), function (progress) {
processCallback = (0, progress_1.progressProcessCallback)(new progress_1.CheckoutProgressParser(), function (progress) {
if (progress.kind === 'progress') {

@@ -113,4 +120,4 @@ var description = progress.details.text;

: ['checkout', name, '--'];
opts = __assign({}, options, { processCallback: processCallback });
return [4 /*yield*/, git_1.git(args, repositoryPath, 'checkoutBranch', opts)];
opts = __assign(__assign({}, options), { processCallback: processCallback });
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'checkoutBranch', opts)];
case 1:

@@ -164,4 +171,4 @@ _a.sent();

args.push('--');
args.push.apply(args, __spread(paths.map(function (p) { return Path.relative(repositoryPath, p); })));
return [4 /*yield*/, git_1.git(args, repositoryPath, 'checkoutPaths', options)];
args.push.apply(args, __spreadArray([], __read(paths.map(function (p) { return Path.relative(repositoryPath, p); })), false));
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'checkoutPaths', options)];
case 1:

@@ -168,0 +175,0 @@ _a.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.clone = void 0;
var git_1 = require("../core/git");

@@ -91,3 +93,3 @@ var progress_1 = require("../progress");

kind_1 = 'clone';
opts = progress_1.executionOptionsWithProgress(opts, new progress_1.CloneProgressParser(), function (progress) {
opts = (0, progress_1.executionOptionsWithProgress)(opts, new progress_1.CloneProgressParser(), function (progress) {
var description = progress.kind === 'progress'

@@ -106,3 +108,3 @@ ? progress.details.text

args.push('--', url, path);
return [4 /*yield*/, git_1.git(args, __dirname, 'clone', opts)];
return [4 /*yield*/, (0, git_1.git)(args, __dirname, 'clone', opts)];
case 1:

@@ -109,0 +111,0 @@ _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -45,6 +45,5 @@ var temp = require("temp");

var track = temp.track();
describe('clone', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('clone', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -55,3 +54,3 @@ track.cleanupSync();

}); });
it('missing', function () { return __awaiter(_this, void 0, void 0, function () {
it('missing', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_1;

@@ -62,3 +61,3 @@ return __generator(this, function (_a) {

_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, clone_1.clone('missing/url/to/git', track.mkdirSync())];
return [4 /*yield*/, (0, clone_1.clone)('missing/url/to/git', track.mkdirSync())];
case 1:

@@ -69,3 +68,3 @@ _a.sent();

error_1 = _a.sent();
chai_1.expect(error_1.message.trim()).to.be.equal("fatal: repository 'missing/url/to/git' does not exist");
(0, chai_1.expect)(error_1.message.trim()).to.be.equal("fatal: repository 'missing/url/to/git' does not exist");
return [3 /*break*/, 3];

@@ -76,3 +75,3 @@ case 3: return [2 /*return*/];

}); });
it('public https', function () { return __awaiter(_this, void 0, void 0, function () {
it('public https', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, status;

@@ -83,9 +82,9 @@ return __generator(this, function (_a) {

repositoryPath = track.mkdirSync();
return [4 /*yield*/, clone_1.clone('https://github.com/TypeFox/dugite-extra.git', repositoryPath)];
return [4 /*yield*/, (0, clone_1.clone)('https://github.com/TypeFox/dugite-extra.git', repositoryPath)];
case 1:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
status = _a.sent();
chai_1.expect(status.workingDirectory.files).to.be.empty;
(0, chai_1.expect)(status.workingDirectory.files).to.be.empty;
return [2 /*return*/];

@@ -92,0 +91,0 @@ }

import { IGitExecutionOptions } from '../core/git';
export declare function createCommit(repositoryPath: string, message: string, signOff?: boolean, amend?: boolean, options?: IGitExecutionOptions): Promise<void>;

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.createCommit = void 0;
var git_1 = require("../core/git");

@@ -72,4 +74,4 @@ function createCommit(repositoryPath, message, signOff, amend, options) {

}
opts = __assign({}, opts, { stdin: message });
return [4 /*yield*/, git_1.git(args, repositoryPath, 'createCommit', opts)];
opts = __assign(__assign({}, opts), { stdin: message });
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'createCommit', opts)];
case 1:

@@ -76,0 +78,0 @@ _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -48,6 +48,5 @@ var temp = require("temp");

var track = temp.track();
describe('commit', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('commit', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -58,3 +57,3 @@ track.cleanupSync();

}); });
it('keeps the line breaks', function () { return __awaiter(_this, void 0, void 0, function () {
it('keeps the line breaks', function () { return __awaiter(void 0, void 0, void 0, function () {
var path, expected, _a, _b;

@@ -65,17 +64,17 @@ return __generator(this, function (_c) {

path = track.mkdirSync('commit-line-breaks');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:
_c.sent();
fs.createFileSync(Path.join(path, 'some-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
expected = "aaaa\n\nbbbb\n\nSigned-off-by: Akos Kitta <kittaakos@gmail.com>\n";
_a = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 2:
_a.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, expected)];
return [4 /*yield*/, (0, commit_1.createCommit)(path, expected)];
case 3:
_c.sent();
_b = chai_1.expect;
return [4 /*yield*/, git_1.git(['log', '--format=%B'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B'], path, 'log')];
case 4:

@@ -88,3 +87,3 @@ _b.apply(void 0, [(_c.sent()).stdout.trim()]).to.be.deep.equal(expected.trim());

describe('sign-off', function () {
it('disabled', function () { return __awaiter(_this, void 0, void 0, function () {
it('disabled', function () { return __awaiter(void 0, void 0, void 0, function () {
var path, userName, _a, _b;

@@ -95,21 +94,21 @@ return __generator(this, function (_c) {

path = track.mkdirSync('commit-sign-off-disabled');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:
_c.sent();
return [4 /*yield*/, git_1.git(['config', 'user.name'], path, 'getUserName')];
return [4 /*yield*/, (0, git_1.git)(['config', 'user.name'], path, 'getUserName')];
case 2:
userName = (_c.sent()).stdout.trim().split('"').join('');
chai_1.expect(userName).not.undefined;
chai_1.expect(userName).not.empty;
(0, chai_1.expect)(userName).not.undefined;
(0, chai_1.expect)(userName).not.empty;
fs.createFileSync(Path.join(path, 'some-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
_a = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 3:
_a.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'some commit message')];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'some commit message')];
case 4:
_c.sent();
_b = chai_1.expect;
return [4 /*yield*/, git_1.git(['log', '--format=%B'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B'], path, 'log')];
case 5:

@@ -121,3 +120,3 @@ _b.apply(void 0, [(_c.sent()).stdout.trim()]).to.not.contain(userName);

}); });
it('enabled', function () { return __awaiter(_this, void 0, void 0, function () {
it('enabled', function () { return __awaiter(void 0, void 0, void 0, function () {
var path, userName, _a, _b;

@@ -128,21 +127,21 @@ return __generator(this, function (_c) {

path = track.mkdirSync('commit-sign-off-enabled');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:
_c.sent();
return [4 /*yield*/, git_1.git(['config', 'user.name'], path, 'getUserName')];
return [4 /*yield*/, (0, git_1.git)(['config', 'user.name'], path, 'getUserName')];
case 2:
userName = (_c.sent()).stdout.trim().split('"').join('');
chai_1.expect(userName).not.undefined;
chai_1.expect(userName).not.empty;
(0, chai_1.expect)(userName).not.undefined;
(0, chai_1.expect)(userName).not.empty;
fs.createFileSync(Path.join(path, 'some-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
_a = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 3:
_a.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'some commit message', true)];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'some commit message', true)];
case 4:
_c.sent();
_b = chai_1.expect;
return [4 /*yield*/, git_1.git(['log', '--format=%B'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B'], path, 'log')];
case 5:

@@ -156,3 +155,3 @@ _b.apply(void 0, [(_c.sent()).stdout.trim()]).to.contain(userName);

describe('amend', function () {
it('w/', function () { return __awaiter(_this, void 0, void 0, function () {
it('w/', function () { return __awaiter(void 0, void 0, void 0, function () {
var path, _a, beforeAmendCommits, _b, afterAmendCommits;

@@ -163,33 +162,33 @@ return __generator(this, function (_c) {

path = track.mkdirSync('commit-with-amend');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:
_c.sent();
fs.createFileSync(Path.join(path, 'some-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
_a = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 2:
_a.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'some commit message')];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'some commit message')];
case 3:
_c.sent();
return [4 /*yield*/, git_1.git(['log', '--format=%B', '-z'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B', '-z'], path, 'log')];
case 4:
beforeAmendCommits = (_c.sent()).stdout.trim().split('\0').filter(function (c) { return c.trim().length > 0; });
chai_1.expect(beforeAmendCommits).to.have.lengthOf(1);
chai_1.expect(beforeAmendCommits[0].trim().endsWith('some commit message')).to.be.true;
(0, chai_1.expect)(beforeAmendCommits).to.have.lengthOf(1);
(0, chai_1.expect)(beforeAmendCommits[0].trim().endsWith('some commit message')).to.be.true;
fs.createFileSync(Path.join(path, 'another-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'another-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'another-file.txt'))).to.be.true;
_b = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 5:
_b.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'another message', false, true)];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'another message', false, true)];
case 6:
_c.sent();
return [4 /*yield*/, git_1.git(['log', '--format=%B', '-z'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B', '-z'], path, 'log')];
case 7:
afterAmendCommits = (_c.sent()).stdout.trim().split('\0').filter(function (c) { return c.trim().length > 0; });
chai_1.expect(afterAmendCommits).to.have.lengthOf(1);
chai_1.expect(afterAmendCommits[0].trim().endsWith('another message')).to.be.true;
(0, chai_1.expect)(afterAmendCommits).to.have.lengthOf(1);
(0, chai_1.expect)(afterAmendCommits[0].trim().endsWith('another message')).to.be.true;
return [2 /*return*/];

@@ -199,3 +198,3 @@ }

}); });
it('w/o', function () { return __awaiter(_this, void 0, void 0, function () {
it('w/o', function () { return __awaiter(void 0, void 0, void 0, function () {
var path, _a, beforeAmendCommits, _b, afterAmendCommits;

@@ -206,34 +205,34 @@ return __generator(this, function (_c) {

path = track.mkdirSync('commit-without-amend');
return [4 /*yield*/, test_helper_1.initRepository(path)];
return [4 /*yield*/, (0, test_helper_1.initRepository)(path)];
case 1:
_c.sent();
fs.createFileSync(Path.join(path, 'some-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'some-file.txt'))).to.be.true;
_a = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 2:
_a.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'some commit message')];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'some commit message')];
case 3:
_c.sent();
return [4 /*yield*/, git_1.git(['log', '--format=%B', '-z'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B', '-z'], path, 'log')];
case 4:
beforeAmendCommits = (_c.sent()).stdout.trim().split('\0').filter(function (c) { return c.trim().length > 0; });
chai_1.expect(beforeAmendCommits).to.have.lengthOf(1);
chai_1.expect(beforeAmendCommits[0].trim().endsWith('some commit message')).to.be.true;
(0, chai_1.expect)(beforeAmendCommits).to.have.lengthOf(1);
(0, chai_1.expect)(beforeAmendCommits[0].trim().endsWith('some commit message')).to.be.true;
fs.createFileSync(Path.join(path, 'another-file.txt'));
chai_1.expect(fs.existsSync(Path.join(path, 'another-file.txt'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(Path.join(path, 'another-file.txt'))).to.be.true;
_b = chai_1.expect;
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 5:
_b.apply(void 0, [(_c.sent()).exitCode]).to.be.equal(0);
return [4 /*yield*/, commit_1.createCommit(path, 'another message', false, false)];
return [4 /*yield*/, (0, commit_1.createCommit)(path, 'another message', false, false)];
case 6:
_c.sent();
return [4 /*yield*/, git_1.git(['log', '--format=%B', '-z'], path, 'log')];
return [4 /*yield*/, (0, git_1.git)(['log', '--format=%B', '-z'], path, 'log')];
case 7:
afterAmendCommits = (_c.sent()).stdout.trim().split('\0').filter(function (c) { return c.trim().length > 0; });
chai_1.expect(afterAmendCommits).to.have.lengthOf(2);
chai_1.expect(afterAmendCommits[0].trim().endsWith('another message')).to.be.true;
chai_1.expect(afterAmendCommits[1].trim().endsWith('some commit message')).to.be.true;
(0, chai_1.expect)(afterAmendCommits).to.have.lengthOf(2);
(0, chai_1.expect)(afterAmendCommits[0].trim().endsWith('another message')).to.be.true;
(0, chai_1.expect)(afterAmendCommits[1].trim().endsWith('some commit message')).to.be.true;
return [2 /*return*/];

@@ -240,0 +239,0 @@ }

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.getWorkingDirectoryImage = exports.getBlobImage = exports.convertDiff = exports.getWorkingDirectoryDiff = exports.getCommitDiff = void 0;
var Path = require("path");

@@ -70,3 +72,3 @@ var Fs = require("fs");

var args = ['log', commitish, '-m', '-1', '--first-parent', '--patch-with-raw', '-z', '--no-color', '--', file.path];
return git_1.git(args, repositoryPath, 'getCommitDiff', options)
return (0, git_1.git)(args, repositoryPath, 'getCommitDiff', options)
.then(function (value) { return diffFromRawDiffOutput(value.stdout); })

@@ -84,3 +86,3 @@ .then(function (diff) { return convertDiff(repositoryPath, file, diff, commitish); });

if (options) {
opts = __assign({}, opts, options);
opts = __assign(__assign({}, opts), options);
}

@@ -101,3 +103,3 @@ var args;

// https://github.com/git/git/blob/1f66975deb8402131fbf7c14330d0c7cdebaeaa2/diff-no-index.c#L300
opts = __assign({}, opts, { successExitCodes: new Set([0, 1]) });
opts = __assign(__assign({}, opts), { successExitCodes: new Set([0, 1]) });
args = ['diff', '--no-ext-diff', '--no-index', '--patch-with-raw', '-z', '--no-color', '--', '/dev/null', file.path];

@@ -118,3 +120,3 @@ }

}
return git_1.git(args, repositoryPath, 'getWorkingDirectoryDiff', opts)
return (0, git_1.git)(args, repositoryPath, 'getWorkingDirectoryDiff', opts)
.then(function (value) { return diffFromRawDiffOutput(value.stdout); })

@@ -236,3 +238,3 @@ .then(function (diff) { return convertDiff(repositoryPath, file, diff, 'HEAD'); });

extension = Path.extname(path);
return [4 /*yield*/, show_1.getBlobContents(repositoryPath, commitish, path)];
return [4 /*yield*/, (0, show_1.getBlobContents)(repositoryPath, commitish, path)];
case 1:

@@ -239,0 +241,0 @@ contents = _a.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchRefspec = exports.fetch = void 0;
var git_1 = require("../core/git");

@@ -76,3 +78,3 @@ var progress_1 = require("../progress");

if (options) {
opts = __assign({}, opts, options);
opts = __assign(__assign({}, opts), options);
}

@@ -82,3 +84,3 @@ if (progressCallback) {

kind_1 = 'fetch';
opts = progress_1.executionOptionsWithProgress(opts, new progress_1.FetchProgressParser(), function (progress) {
opts = (0, progress_1.executionOptionsWithProgress)(opts, new progress_1.FetchProgressParser(), function (progress) {
// In addition to progress output from the remote end and from

@@ -103,3 +105,3 @@ // git itself, the stderr output from pull contains information

: ['fetch', remote];
return [4 /*yield*/, git_1.git(args, repositoryPath, 'fetch', opts)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'fetch', opts)];
case 1:

@@ -124,6 +126,6 @@ _a.sent();

if (options) {
opts = __assign({}, opts, options);
opts = __assign(__assign({}, opts), options);
}
args = ['fetch', remote, refspec];
return [4 /*yield*/, git_1.git(args, repositoryPath, 'fetchRefspec', opts)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'fetchRefspec', opts)];
case 1:

@@ -130,0 +132,0 @@ _a.sent();

@@ -0,0 +0,0 @@ export * from './apply';

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./apply"));
__export(require("./branch"));
__export(require("./checkout"));
__export(require("./clone"));
__export(require("./commit"));
__export(require("./diff"));
__export(require("./fetch"));
__export(require("./merge"));
__export(require("./pull"));
__export(require("./push"));
__export(require("./reset"));
__export(require("./show"));
__export(require("./stage"));
__export(require("./status"));
__export(require("./update-index"));
__exportStar(require("./apply"), exports);
__exportStar(require("./branch"), exports);
__exportStar(require("./checkout"), exports);
__exportStar(require("./clone"), exports);
__exportStar(require("./commit"), exports);
__exportStar(require("./diff"), exports);
__exportStar(require("./fetch"), exports);
__exportStar(require("./merge"), exports);
__exportStar(require("./pull"), exports);
__exportStar(require("./push"), exports);
__exportStar(require("./reset"), exports);
__exportStar(require("./show"), exports);
__exportStar(require("./stage"), exports);
__exportStar(require("./status"), exports);
__exportStar(require("./update-index"), exports);
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -38,2 +39,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.logCommitSHAs = void 0;
var Path = require("path");

@@ -53,3 +55,3 @@ var git_1 = require("../core/git");

switch (_a.label) {
case 0: return [4 /*yield*/, git_1.git(['log', '--follow', '--pretty="%h"', Path.relative(repositoryPath, path)], repositoryPath, 'logCommitSHAs', options)];
case 0: return [4 /*yield*/, (0, git_1.git)(['log', '--follow', '--pretty="%h"', Path.relative(repositoryPath, path)], repositoryPath, 'logCommitSHAs', options)];
case 1:

@@ -56,0 +58,0 @@ result = _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -50,6 +50,5 @@ var fs = require("fs");

var track = temp.track();
describe('log', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('log', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -60,3 +59,3 @@ track.cleanupSync();

}); });
it('logCommitSHAs', function () { return __awaiter(_this, void 0, void 0, function () {
it('logCommitSHAs', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, fileName, _a, _b, _c, _d, _e, _f, _g;

@@ -67,3 +66,3 @@ return __generator(this, function (_h) {

repositoryPath = track.mkdirSync('test-repo-path');
return [4 /*yield*/, test_helper_1.createTestRepository(repositoryPath)];
return [4 /*yield*/, (0, test_helper_1.createTestRepository)(repositoryPath)];
case 1:

@@ -73,43 +72,43 @@ _h.sent();

_a = chai_1.expect;
return [4 /*yield*/, log_1.logCommitSHAs(repositoryPath, fileName)];
return [4 /*yield*/, (0, log_1.logCommitSHAs)(repositoryPath, fileName)];
case 2:
_a.apply(void 0, [_h.sent()]).to.be.lengthOf(1);
fs.writeFileSync(fileName, 'second commit', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('second commit');
return [4 /*yield*/, stage_1.stage(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('second commit');
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, fileName)];
case 3:
_h.sent();
_b = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
_b.apply(void 0, [(_h.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.lengthOf(1);
return [4 /*yield*/, commit_1.createCommit(repositoryPath, 'second')];
return [4 /*yield*/, (0, commit_1.createCommit)(repositoryPath, 'second')];
case 5:
_h.sent();
_c = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 6:
_c.apply(void 0, [(_h.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.empty;
_d = chai_1.expect;
return [4 /*yield*/, log_1.logCommitSHAs(repositoryPath, fileName)];
return [4 /*yield*/, (0, log_1.logCommitSHAs)(repositoryPath, fileName)];
case 7:
_d.apply(void 0, [_h.sent()]).to.be.lengthOf(2);
fs.writeFileSync(fileName, 'third commit', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('third commit');
return [4 /*yield*/, stage_1.stage(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('third commit');
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, fileName)];
case 8:
_h.sent();
_e = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 9:
_e.apply(void 0, [(_h.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.lengthOf(1);
return [4 /*yield*/, commit_1.createCommit(repositoryPath, 'third')];
return [4 /*yield*/, (0, commit_1.createCommit)(repositoryPath, 'third')];
case 10:
_h.sent();
_f = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 11:
_f.apply(void 0, [(_h.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.empty;
_g = chai_1.expect;
return [4 /*yield*/, log_1.logCommitSHAs(repositoryPath, fileName)];
return [4 /*yield*/, (0, log_1.logCommitSHAs)(repositoryPath, fileName)];
case 12:

@@ -116,0 +115,0 @@ _g.apply(void 0, [_h.sent()]).to.be.lengthOf(3);

import { IGitExecutionOptions } from '../core/git';
/** Merge the named branch into the current branch. */
export declare function merge(repositoryPath: string, branch: string, options?: IGitExecutionOptions): Promise<void>;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -38,2 +39,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.merge = void 0;
var git_1 = require("../core/git");

@@ -45,3 +47,3 @@ /** Merge the named branch into the current branch. */

switch (_a.label) {
case 0: return [4 /*yield*/, git_1.git(['merge', branch], repositoryPath, 'merge', options)];
case 0: return [4 /*yield*/, (0, git_1.git)(['merge', branch], repositoryPath, 'merge', options)];
case 1:

@@ -48,0 +50,0 @@ _a.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.pull = void 0;
var git_1 = require("../core/git");

@@ -77,3 +79,3 @@ var progress_1 = require("../progress");

if (options) {
opts = __assign({}, opts, options);
opts = __assign(__assign({}, opts), options);
}

@@ -83,3 +85,3 @@ if (progressCallback) {

kind_1 = 'pull';
opts = progress_1.executionOptionsWithProgress(opts, new progress_1.PullProgressParser(), function (progress) {
opts = (0, progress_1.executionOptionsWithProgress)(opts, new progress_1.PullProgressParser(), function (progress) {
// In addition to progress output from the remote end and from

@@ -108,3 +110,3 @@ // git itself, the stderr output from pull contains information

}
return [4 /*yield*/, git_1.git(args, repositoryPath, 'pull', opts)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'pull', opts)];
case 1:

@@ -111,0 +113,0 @@ result = _a.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.push = void 0;
var git_1 = require("../core/git");

@@ -88,3 +90,3 @@ var progress_1 = require("../progress");

if (options) {
opts = __assign({}, opts, options);
opts = __assign(__assign({}, opts), options);
}

@@ -95,3 +97,3 @@ if (progressCallback) {

kind_1 = 'push';
opts = progress_1.executionOptionsWithProgress(opts, new progress_1.PushProgressParser(), function (progress) {
opts = (0, progress_1.executionOptionsWithProgress)(opts, new progress_1.PushProgressParser(), function (progress) {
var description = progress.kind === 'progress' ? progress.details.text : progress.text;

@@ -117,3 +119,3 @@ var value = progress.percent;

}
return [4 /*yield*/, git_1.git(args, repositoryPath, 'push', opts)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'push', opts)];
case 1:

@@ -120,0 +122,0 @@ result = _a.sent();

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -53,7 +54,13 @@ });

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.unstageAll = exports.resetPaths = exports.reset = void 0;
var git_1 = require("../core/git");

@@ -80,3 +87,3 @@ function resetModeToFlag(mode) {

modeFlag = resetModeToFlag(mode);
return [4 /*yield*/, git_1.git(['reset', modeFlag, ref, '--'], repositoryPath, 'reset', options)];
return [4 /*yield*/, (0, git_1.git)(['reset', modeFlag, ref, '--'], repositoryPath, 'reset', options)];
case 1:

@@ -115,3 +122,3 @@ _a.sent();

modeFlag = resetModeToFlag(mode);
return [4 /*yield*/, git_1.git(__spread(['reset', modeFlag, ref, '--'], paths), repositoryPath, 'reset', options)];
return [4 /*yield*/, (0, git_1.git)(__spreadArray(['reset', modeFlag, ref, '--'], __read(paths), false), repositoryPath, 'reset', options)];
case 1:

@@ -130,3 +137,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, git_1.git(['reset', '--', '.'], repositoryPath, 'unstageAll', options)];
case 0: return [4 /*yield*/, (0, git_1.git)(['reset', '--', '.'], repositoryPath, 'unstageAll', options)];
case 1:

@@ -133,0 +140,0 @@ _a.sent();

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,2 +51,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.getBlobContents = exports.getTextContents = void 0;
var path_1 = require("path");

@@ -56,4 +58,4 @@ var git_1 = require("../core/git");

var successExitCodes = new Set([0, 1]);
var utf8Encoding = function (cb) { return cb.stdout.setEncoding('utf8'); };
var binaryEncoding = function (cb) { return cb.stdout.setEncoding('binary'); };
var utf8Encoding = function (cb) { var _a; return (_a = cb.stdout) === null || _a === void 0 ? void 0 : _a.setEncoding('utf8'); };
var binaryEncoding = function (cb) { var _a; return (_a = cb.stdout) === null || _a === void 0 ? void 0 : _a.setEncoding('binary'); };
/**

@@ -78,5 +80,5 @@ * Retrieve the text (UTF-8) contents of a file from the repository at a given

case 0:
args = ['show', commitish + ":" + normalizeSafe(path_1.relative(repositoryPath, path))];
opts = __assign({}, options, { successExitCodes: successExitCodes, processCallback: utf8Encoding });
return [4 /*yield*/, git_1.git(args, repositoryPath, 'getTextContents', opts)];
args = ['show', commitish + ":" + normalizeSafe((0, path_1.relative)(repositoryPath, path))];
opts = __assign(__assign({}, options), { successExitCodes: successExitCodes, processCallback: utf8Encoding });
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'getTextContents', opts)];
case 1:

@@ -110,4 +112,4 @@ textContents = _a.sent();

args = ['show', commitish + ":" + path];
opts = __assign({}, options, { successExitCodes: successExitCodes, processCallback: binaryEncoding });
return [4 /*yield*/, git_1.git(args, repositoryPath, 'getBlobContents', opts)];
opts = __assign(__assign({}, options), { successExitCodes: successExitCodes, processCallback: binaryEncoding });
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'getBlobContents', opts)];
case 1:

@@ -114,0 +116,0 @@ blobContents = _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -53,3 +54,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -67,6 +67,5 @@ var fs = require("fs");

var track = temp.track();
describe('show', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('show', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -77,3 +76,3 @@ track.cleanupSync();

}); });
it('diff', function () { return __awaiter(_this, void 0, void 0, function () {
it('diff', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, fileName, _a, _b, _c, _d, SHAs, _e, HEAD, second, first, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, nestedFileName, _v, _w, _x, _y, _z;

@@ -85,3 +84,3 @@ var _0;

repositoryPath = track.mkdirSync('test-repo-path');
return [4 /*yield*/, test_helper_1.createTestRepository(repositoryPath)];
return [4 /*yield*/, (0, test_helper_1.createTestRepository)(repositoryPath)];
case 1:

@@ -91,131 +90,131 @@ _1.sent();

fs.writeFileSync(fileName, 'second commit', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('second commit');
return [4 /*yield*/, stage_1.stage(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('second commit');
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, fileName)];
case 2:
_1.sent();
_a = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 3:
_a.apply(void 0, [(_1.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.lengthOf(1);
return [4 /*yield*/, commit_1.createCommit(repositoryPath, 'second')];
return [4 /*yield*/, (0, commit_1.createCommit)(repositoryPath, 'second')];
case 4:
_1.sent();
_b = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 5:
_b.apply(void 0, [(_1.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.empty;
fs.writeFileSync(fileName, 'third commit', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('third commit');
return [4 /*yield*/, stage_1.stage(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('third commit');
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, fileName)];
case 6:
_1.sent();
_c = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 7:
_c.apply(void 0, [(_1.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.lengthOf(1);
return [4 /*yield*/, commit_1.createCommit(repositoryPath, 'third')];
return [4 /*yield*/, (0, commit_1.createCommit)(repositoryPath, 'third')];
case 8:
_1.sent();
_d = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 9:
_d.apply(void 0, [(_1.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.empty;
return [4 /*yield*/, log_1.logCommitSHAs(repositoryPath, fileName)];
return [4 /*yield*/, (0, log_1.logCommitSHAs)(repositoryPath, fileName)];
case 10:
SHAs = _1.sent();
chai_1.expect(SHAs).to.be.lengthOf(3);
(0, chai_1.expect)(SHAs).to.be.lengthOf(3);
_e = __read(SHAs, 3), HEAD = _e[0], second = _e[1], first = _e[2];
_f = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, HEAD, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, HEAD, fileName)];
case 11:
_f.apply(void 0, [(_1.sent()).toString()]).to.be.equal('third commit');
_g = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, second, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, second, fileName)];
case 12:
_g.apply(void 0, [(_1.sent()).toString()]).to.be.equal('second commit');
_h = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, first, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, first, fileName)];
case 13:
_h.apply(void 0, [(_1.sent()).toString()]).to.be.equal('A');
_j = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD', fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD', fileName)];
case 14:
_j.apply(void 0, [(_1.sent()).toString()]).to.be.equal('third commit');
fs.writeFileSync(fileName, 'just staged', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('just staged');
return [4 /*yield*/, stage_1.stage(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('just staged');
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, fileName)];
case 15:
_1.sent();
_k = chai_1.expect;
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 16:
_k.apply(void 0, [(_1.sent()).workingDirectory.files.filter(function (f) { return f.staged; })]).to.be.lengthOf(1);
fs.writeFileSync(fileName, 'changed but un-staged', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('changed but un-staged');
return [4 /*yield*/, log_1.logCommitSHAs(repositoryPath, fileName)];
(0, chai_1.expect)(fs.readFileSync(fileName, { encoding: 'utf8' })).to.be.equal('changed but un-staged');
return [4 /*yield*/, (0, log_1.logCommitSHAs)(repositoryPath, fileName)];
case 17:
SHAs = _1.sent();
chai_1.expect(SHAs).to.be.lengthOf(3);
(0, chai_1.expect)(SHAs).to.be.lengthOf(3);
_0 = __read(SHAs, 3), HEAD = _0[0], second = _0[1], first = _0[2];
_l = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, HEAD, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, HEAD, fileName)];
case 18:
_l.apply(void 0, [(_1.sent()).toString()]).to.be.equal('third commit');
_m = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, second, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, second, fileName)];
case 19:
_m.apply(void 0, [(_1.sent()).toString()]).to.be.equal('second commit');
_o = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, first, fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, first, fileName)];
case 20:
_o.apply(void 0, [(_1.sent()).toString()]).to.be.equal('A');
_p = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD', fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD', fileName)];
case 21:
_p.apply(void 0, [(_1.sent()).toString()]).to.be.equal('third commit');
_q = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD~1', fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD~1', fileName)];
case 22:
_q.apply(void 0, [(_1.sent()).toString()]).to.be.equal('second commit');
_r = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD~2', fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD~2', fileName)];
case 23:
_r.apply(void 0, [(_1.sent()).toString()]).to.be.equal('A');
_s = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, HEAD + "~1", fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, HEAD + "~1", fileName)];
case 24:
_s.apply(void 0, [(_1.sent()).toString()]).to.be.equal('second commit');
_t = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, HEAD + "~2", fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, HEAD + "~2", fileName)];
case 25:
_t.apply(void 0, [(_1.sent()).toString()]).to.be.equal('A');
_u = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, '', fileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, '', fileName)];
case 26:
_u.apply(void 0, [(_1.sent()).toString()]).to.be.equal('just staged');
nestedFileName = Path.join(repositoryPath, 'folder', 'C.txt');
chai_1.expect(fs.readFileSync(nestedFileName, { encoding: 'utf8' })).to.be.equal('C');
(0, chai_1.expect)(fs.readFileSync(nestedFileName, { encoding: 'utf8' })).to.be.equal('C');
_v = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD', nestedFileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD', nestedFileName)];
case 27:
_v.apply(void 0, [(_1.sent()).toString()]).to.be.equal('C');
fs.writeFileSync(nestedFileName, 'some other content', { encoding: 'utf8' });
chai_1.expect(fs.readFileSync(nestedFileName, { encoding: 'utf8' })).to.be.equal('some other content');
(0, chai_1.expect)(fs.readFileSync(nestedFileName, { encoding: 'utf8' })).to.be.equal('some other content');
_w = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD', nestedFileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD', nestedFileName)];
case 28:
_w.apply(void 0, [(_1.sent()).toString()]).to.be.equal('C');
_x = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, '', nestedFileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, '', nestedFileName)];
case 29:
_x.apply(void 0, [(_1.sent()).toString()]).to.be.equal('C');
return [4 /*yield*/, stage_1.stage(repositoryPath, nestedFileName)];
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, nestedFileName)];
case 30:
_1.sent();
_y = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, 'HEAD', nestedFileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, 'HEAD', nestedFileName)];
case 31:
_y.apply(void 0, [(_1.sent()).toString()]).to.be.equal('C');
_z = chai_1.expect;
return [4 /*yield*/, show_1.getTextContents(repositoryPath, '', nestedFileName)];
return [4 /*yield*/, (0, show_1.getTextContents)(repositoryPath, '', nestedFileName)];
case 32:

@@ -222,0 +221,0 @@ _z.apply(void 0, [(_1.sent()).toString()]).to.be.equal('some other content');

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -53,7 +54,13 @@ });

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStagedFiles = exports.unstage = exports.stage = void 0;
var path = require("path");

@@ -79,5 +86,5 @@ var git_1 = require("../core/git");

else {
paths.push.apply(paths, __spread((Array.isArray(filePaths) ? filePaths : [filePaths]).map(function (f) { return path.relative(repositoryPath, f); })));
paths.push.apply(paths, __spreadArray([], __read((Array.isArray(filePaths) ? filePaths : [filePaths]).map(function (f) { return path.relative(repositoryPath, f); })), false));
}
return [4 /*yield*/, git_1.git(__spread(['add'], paths), repositoryPath, 'stage', options)];
return [4 /*yield*/, (0, git_1.git)(__spreadArray(['add'], __read(paths), false), repositoryPath, 'stage', options)];
case 1:

@@ -110,3 +117,3 @@ _a.sent();

_where = where || 'all';
return [4 /*yield*/, git_1.git(['branch'], repositoryPath, 'branch', options)];
return [4 /*yield*/, (0, git_1.git)(['branch'], repositoryPath, 'branch', options)];
case 1:

@@ -117,7 +124,7 @@ branch = _a.sent();

if (!branch.stdout.trim()) {
args.push.apply(args, __spread(['rm', '--cached', '-r', '--']));
args.push.apply(args, ['rm', '--cached', '-r', '--']);
}
else {
if (_where === 'working-tree') {
args.push.apply(args, __spread(['checkout-index', '-f', '-u']));
args.push.apply(args, ['checkout-index', '-f', '-u']);
}

@@ -130,3 +137,3 @@ else {

}
args.push.apply(args, __spread([_treeish, '--']));
args.push.apply(args, [_treeish, '--']);
}

@@ -138,6 +145,6 @@ paths = [];

else {
paths.push.apply(paths, __spread((Array.isArray(filePaths) ? filePaths : [filePaths]).map(function (f) { return path.relative(repositoryPath, f); })));
paths.push.apply(paths, __spreadArray([], __read((Array.isArray(filePaths) ? filePaths : [filePaths]).map(function (f) { return path.relative(repositoryPath, f); })), false));
}
args.push.apply(args, __spread(paths));
return [4 /*yield*/, git_1.git(args, repositoryPath, 'unstage', options)];
args.push.apply(args, __spreadArray([], __read(paths), false));
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'unstage', options)];
case 2:

@@ -161,3 +168,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, status_1.getStatus(repositoryPath, true, Number.MIN_SAFE_INTEGER, options)];
case 0: return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath, true, Number.MIN_SAFE_INTEGER, options)];
case 1:

@@ -164,0 +171,0 @@ status = _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -53,7 +54,11 @@ });

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -69,6 +74,5 @@ var path = require("path");

var track = temp.track();
describe('stage', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('stage', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -79,6 +83,5 @@ track.cleanupSync();

}); });
describe('stage', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('stage', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
it('missing', function () { return __awaiter(_this, void 0, void 0, function () {
it('missing', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_1;

@@ -89,3 +92,3 @@ return __generator(this, function (_a) {

_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, stage_1.stage('/does/not/exist', [])];
return [4 /*yield*/, (0, stage_1.stage)('/does/not/exist', [])];
case 1:

@@ -96,3 +99,3 @@ _a.sent();

error_1 = _a.sent();
chai_1.expect(error_1.message).to.be.equal('Unable to find path to repository on disk.');
(0, chai_1.expect)(error_1.message).to.be.equal('Unable to find path to repository on disk.');
return [3 /*break*/, 3];

@@ -103,29 +106,29 @@ case 3: return [2 /*return*/];

}); });
it('new', function () { return __awaiter(_this, void 0, void 0, function () {
it('new', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, beforeStatus, files, afterStatus;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.add(repositoryPath, { path: 'X.txt' });
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.add)(repositoryPath, { path: 'X.txt' });
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
beforeStatus = _a.sent();
files = beforeStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[0].staged).to.be.false;
return [4 /*yield*/, stage_1.stage(repositoryPath, filePaths)];
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[0].staged).to.be.false;
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, filePaths)];
case 3:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[0].staged).to.be.true;
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[0].staged).to.be.true;
return [2 /*return*/];

@@ -135,28 +138,28 @@ }

}); });
it('deleted', function () { return __awaiter(_this, void 0, void 0, function () {
it('deleted', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, beforeStatus, files, afterStatus;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.remove(repositoryPath, 'A.txt');
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.remove)(repositoryPath, 'A.txt');
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
beforeStatus = _a.sent();
files = beforeStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
return [4 /*yield*/, stage_1.stage(repositoryPath, filePaths)];
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, filePaths)];
case 3:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
chai_1.expect(files[0].staged).to.be.true;
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
(0, chai_1.expect)(files[0].staged).to.be.true;
return [2 /*return*/];

@@ -166,28 +169,28 @@ }

}); });
it('modified', function () { return __awaiter(_this, void 0, void 0, function () {
it('modified', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, beforeStatus, files, afterStatus;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'content' });
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'content' });
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
beforeStatus = _a.sent();
files = beforeStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Modified);
return [4 /*yield*/, stage_1.stage(repositoryPath, filePaths)];
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Modified);
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, filePaths)];
case 3:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Modified);
chai_1.expect(files[0].staged).to.be.true;
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Modified);
(0, chai_1.expect)(files[0].staged).to.be.true;
return [2 /*return*/];

@@ -197,35 +200,35 @@ }

}); });
it('stage multiple files', function () { return __awaiter(_this, void 0, void 0, function () {
it('stage multiple files', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, beforeStatus, files, afterStatus;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.add(repositoryPath, [{ path: 'X.txt' }, { path: 'Y.txt' }]);
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.add)(repositoryPath, [{ path: 'X.txt' }, { path: 'Y.txt' }]);
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
beforeStatus = _a.sent();
files = beforeStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(2);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[0].staged).to.be.false;
chai_1.expect(files[1].path).to.be.equal(path.relative(repositoryPath, filePaths[1]));
chai_1.expect(files[1].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[1].staged).to.be.false;
return [4 /*yield*/, stage_1.stage(repositoryPath)];
(0, chai_1.expect)(files).to.have.lengthOf(2);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[0].staged).to.be.false;
(0, chai_1.expect)(files[1].path).to.be.equal(path.relative(repositoryPath, filePaths[1]));
(0, chai_1.expect)(files[1].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[1].staged).to.be.false;
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath)];
case 3:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(2);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[0].staged).to.be.true;
chai_1.expect(files[1].path).to.be.equal(path.relative(repositoryPath, filePaths[1]));
chai_1.expect(files[1].status).to.be.equal(status_2.FileStatus.New);
chai_1.expect(files[1].staged).to.be.true;
(0, chai_1.expect)(files).to.have.lengthOf(2);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[0].staged).to.be.true;
(0, chai_1.expect)(files[1].path).to.be.equal(path.relative(repositoryPath, filePaths[1]));
(0, chai_1.expect)(files[1].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files[1].staged).to.be.true;
return [2 /*return*/];

@@ -238,6 +241,5 @@ }

}); });
describe('getStagedFiles', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('getStagedFiles', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
it('missing', function () { return __awaiter(_this, void 0, void 0, function () {
it('missing', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_2;

@@ -248,3 +250,3 @@ return __generator(this, function (_a) {

_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, stage_1.getStagedFiles('/does/not/exist')];
return [4 /*yield*/, (0, stage_1.getStagedFiles)('/does/not/exist')];
case 1:

@@ -255,3 +257,3 @@ _a.sent();

error_2 = _a.sent();
chai_1.expect(error_2.message).to.be.equal('Unable to find path to repository on disk.');
(0, chai_1.expect)(error_2.message).to.be.equal('Unable to find path to repository on disk.');
return [3 /*break*/, 3];

@@ -262,28 +264,28 @@ case 3: return [2 /*return*/];

}); });
it('new/deleted/modified', function () { return __awaiter(_this, void 0, void 0, function () {
it('new/deleted/modified', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, toStage, files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
toStage = __spread(test_helper_1.add(repositoryPath, { path: 'X.txt', data: 'X' }), test_helper_1.remove(repositoryPath, 'A.txt'), test_helper_1.rename(repositoryPath, { oldPath: 'B.txt', newPath: 'Y.txt' }));
return [4 /*yield*/, stage_1.stage(repositoryPath, toStage)];
toStage = __spreadArray(__spreadArray(__spreadArray([], __read((0, test_helper_1.add)(repositoryPath, { path: 'X.txt', data: 'X' })), false), __read((0, test_helper_1.remove)(repositoryPath, 'A.txt')), false), __read((0, test_helper_1.rename)(repositoryPath, { oldPath: 'B.txt', newPath: 'Y.txt' })), false);
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, toStage)];
case 2:
_a.sent();
return [4 /*yield*/, stage_1.getStagedFiles(repositoryPath)];
return [4 /*yield*/, (0, stage_1.getStagedFiles)(repositoryPath)];
case 3:
files = _a.sent();
chai_1.expect(files).to.be.lengthOf(3);
chai_1.expect(files.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'X.txt', 'Y.txt']);
chai_1.expect(files.map(function (f) { return f.oldPath; }).filter(function (p) { return p; })).to.deep.equal(['B.txt']);
return [4 /*yield*/, stage_1.unstage(repositoryPath, toStage.filter(function (f) { return f.endsWith('A.txt'); }))];
(0, chai_1.expect)(files).to.be.lengthOf(3);
(0, chai_1.expect)(files.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'X.txt', 'Y.txt']);
(0, chai_1.expect)(files.map(function (f) { return f.oldPath; }).filter(function (p) { return p; })).to.deep.equal(['B.txt']);
return [4 /*yield*/, (0, stage_1.unstage)(repositoryPath, toStage.filter(function (f) { return f.endsWith('A.txt'); }))];
case 4:
_a.sent();
return [4 /*yield*/, stage_1.getStagedFiles(repositoryPath)];
return [4 /*yield*/, (0, stage_1.getStagedFiles)(repositoryPath)];
case 5:
files = _a.sent();
chai_1.expect(files).to.be.lengthOf(2);
chai_1.expect(files.map(function (f) { return f.path; })).to.deep.equal(['X.txt', 'Y.txt']);
chai_1.expect(files.map(function (f) { return f.oldPath; }).filter(function (p) { return p; })).to.deep.equal(['B.txt']);
(0, chai_1.expect)(files).to.be.lengthOf(2);
(0, chai_1.expect)(files.map(function (f) { return f.path; })).to.deep.equal(['X.txt', 'Y.txt']);
(0, chai_1.expect)(files.map(function (f) { return f.oldPath; }).filter(function (p) { return p; })).to.deep.equal(['B.txt']);
return [2 /*return*/];

@@ -293,26 +295,26 @@ }

}); });
it('modifying a staged file should result in two changes', function () { return __awaiter(_this, void 0, void 0, function () {
it('modifying a staged file should result in two changes', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, stagedFiles, status, changedFiles;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
return [4 /*yield*/, stage_1.stage(repositoryPath, test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'new content' }))];
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'new content' }))];
case 2:
_a.sent();
return [4 /*yield*/, stage_1.getStagedFiles(repositoryPath)];
return [4 /*yield*/, (0, stage_1.getStagedFiles)(repositoryPath)];
case 3:
stagedFiles = _a.sent();
chai_1.expect(stagedFiles).to.be.lengthOf(1);
chai_1.expect(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
(0, chai_1.expect)(stagedFiles).to.be.lengthOf(1);
(0, chai_1.expect)(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
fs.writeFileSync(path.join(repositoryPath, 'A.txt'), 'yet another new content', 'utf8');
chai_1.expect(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('yet another new content');
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
(0, chai_1.expect)(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('yet another new content');
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
status = _a.sent();
changedFiles = status.workingDirectory.files;
chai_1.expect(changedFiles).to.be.lengthOf(2);
chai_1.expect(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
chai_1.expect(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
(0, chai_1.expect)(changedFiles).to.be.lengthOf(2);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
return [2 /*return*/];

@@ -322,37 +324,37 @@ }

}); });
it('reverting the index state should not modify the working tree', function () { return __awaiter(_this, void 0, void 0, function () {
it('reverting the index state should not modify the working tree', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, stagedFiles, thePath, status, changedFiles, afterStatus, afterChangedFiles;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
return [4 /*yield*/, stage_1.stage(repositoryPath, test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index' }))];
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index' }))];
case 2:
_a.sent();
return [4 /*yield*/, stage_1.getStagedFiles(repositoryPath)];
return [4 /*yield*/, (0, stage_1.getStagedFiles)(repositoryPath)];
case 3:
stagedFiles = _a.sent();
chai_1.expect(stagedFiles).to.be.lengthOf(1);
chai_1.expect(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
thePath = test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index\nAnother modification in the working tree' })[0];
chai_1.expect(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
(0, chai_1.expect)(stagedFiles).to.be.lengthOf(1);
(0, chai_1.expect)(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
thePath = (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index\nAnother modification in the working tree' })[0];
(0, chai_1.expect)(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
status = _a.sent();
changedFiles = status.workingDirectory.files;
chai_1.expect(changedFiles).to.be.lengthOf(2);
chai_1.expect(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
chai_1.expect(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
return [4 /*yield*/, stage_1.unstage(repositoryPath, thePath, 'HEAD', 'index')];
(0, chai_1.expect)(changedFiles).to.be.lengthOf(2);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
return [4 /*yield*/, (0, stage_1.unstage)(repositoryPath, thePath, 'HEAD', 'index')];
case 5:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 6:
afterStatus = _a.sent();
afterChangedFiles = afterStatus.workingDirectory.files;
chai_1.expect(afterChangedFiles).to.be.lengthOf(1);
chai_1.expect(afterChangedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
chai_1.expect(afterChangedFiles.map(function (f) { return f.staged; })).to.deep.equal([false]);
chai_1.expect(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
(0, chai_1.expect)(afterChangedFiles).to.be.lengthOf(1);
(0, chai_1.expect)(afterChangedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
(0, chai_1.expect)(afterChangedFiles.map(function (f) { return f.staged; })).to.deep.equal([false]);
(0, chai_1.expect)(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
return [2 /*return*/];

@@ -362,37 +364,37 @@ }

}); });
it('reverting the state in the working tree should not modify the index state', function () { return __awaiter(_this, void 0, void 0, function () {
xit('reverting the state in the working tree should not modify the index state', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, stagedFiles, thePath, status, changedFiles, afterStatus, afterChangedFiles;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
return [4 /*yield*/, stage_1.stage(repositoryPath, test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index' }))];
return [4 /*yield*/, (0, stage_1.stage)(repositoryPath, (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index' }))];
case 2:
_a.sent();
return [4 /*yield*/, stage_1.getStagedFiles(repositoryPath)];
return [4 /*yield*/, (0, stage_1.getStagedFiles)(repositoryPath)];
case 3:
stagedFiles = _a.sent();
chai_1.expect(stagedFiles).to.be.lengthOf(1);
chai_1.expect(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
thePath = test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index\nAnother modification in the working tree' })[0];
chai_1.expect(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
(0, chai_1.expect)(stagedFiles).to.be.lengthOf(1);
(0, chai_1.expect)(stagedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
thePath = (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'A\nModification in the index\nAnother modification in the working tree' })[0];
(0, chai_1.expect)(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index\nAnother modification in the working tree');
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
status = _a.sent();
changedFiles = status.workingDirectory.files;
chai_1.expect(changedFiles).to.be.lengthOf(2);
chai_1.expect(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
chai_1.expect(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
return [4 /*yield*/, stage_1.unstage(repositoryPath, thePath, 'HEAD', 'working-tree')];
(0, chai_1.expect)(changedFiles).to.be.lengthOf(2);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt', 'A.txt']);
(0, chai_1.expect)(changedFiles.map(function (f) { return f.staged; }).sort()).to.deep.equal([false, true]);
return [4 /*yield*/, (0, stage_1.unstage)(repositoryPath, thePath, 'HEAD', 'working-tree')];
case 5:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 6:
afterStatus = _a.sent();
afterChangedFiles = afterStatus.workingDirectory.files;
chai_1.expect(afterChangedFiles).to.be.lengthOf(1);
chai_1.expect(afterChangedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
chai_1.expect(afterChangedFiles.map(function (f) { return f.staged; })).to.deep.equal([true]);
chai_1.expect(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index');
(0, chai_1.expect)(afterChangedFiles).to.be.lengthOf(1);
(0, chai_1.expect)(afterChangedFiles.map(function (f) { return f.path; })).to.deep.equal(['A.txt']);
(0, chai_1.expect)(afterChangedFiles.map(function (f) { return f.staged; })).to.deep.equal([true]);
(0, chai_1.expect)(fs.readFileSync(path.join(repositoryPath, 'A.txt'), 'utf8')).to.be.deep.equal('A\nModification in the index');
return [2 /*return*/];

@@ -399,0 +401,0 @@ }

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from "../core";

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -38,2 +39,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.stash = void 0;
var core_1 = require("../core");

@@ -58,3 +60,3 @@ var stash;

}
return [4 /*yield*/, core_1.git(args, repositoryPath, 'stash', options)];
return [4 /*yield*/, (0, core_1.git)(args, repositoryPath, 'stash', options)];
case 1:

@@ -78,3 +80,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, core_1.git(['stash', 'list'], repositoryPath, 'stash_list', options)];
case 0: return [4 /*yield*/, (0, core_1.git)(['stash', 'list'], repositoryPath, 'stash_list', options)];
case 1:

@@ -104,3 +106,3 @@ result = _a.sent();

}
return [4 /*yield*/, core_1.git(args, repositoryPath, 'stash_apply', options)];
return [4 /*yield*/, (0, core_1.git)(args, repositoryPath, 'stash_apply', options)];
case 1:

@@ -130,3 +132,3 @@ _a.sent();

}
return [4 /*yield*/, core_1.git(args, repositoryPath, 'stash_pop', options)];
return [4 /*yield*/, (0, core_1.git)(args, repositoryPath, 'stash_pop', options)];
case 1:

@@ -156,3 +158,3 @@ _a.sent();

}
return [4 /*yield*/, core_1.git(args, repositoryPath, 'stash_drop', options)];
return [4 /*yield*/, (0, core_1.git)(args, repositoryPath, 'stash_drop', options)];
case 1:

@@ -175,3 +177,3 @@ _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, core_1.git(['stash', 'clear'], repositoryPath, 'stash_clear', options)];
case 0: return [4 /*yield*/, (0, core_1.git)(['stash', 'clear'], repositoryPath, 'stash_clear', options)];
case 1:

@@ -178,0 +180,0 @@ _a.sent();

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -47,9 +47,8 @@ var temp = require("temp");

var track = temp.track();
describe('stash', function () { return __awaiter(_this, void 0, void 0, function () {
describe('stash', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, testText, testText2;
var _this = this;
return __generator(this, function (_a) {
testText = 'A modified';
testText2 = 'This is a completely different text.';
afterEach(function () { return __awaiter(_this, void 0, void 0, function () {
afterEach(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -60,6 +59,6 @@ track.cleanupSync();

}); });
beforeEach(function () { return __awaiter(_this, void 0, void 0, function () {
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:

@@ -71,6 +70,5 @@ repositoryPath = _a.sent();

}); });
describe('stash', function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
describe('stash', function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
it('push', function () { return __awaiter(_this, void 0, void 0, function () {
it('push', function () { return __awaiter(void 0, void 0, void 0, function () {
var files, beforeStatus, afterStatus;

@@ -80,16 +78,16 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 1:
beforeStatus = _a.sent();
files = beforeStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
(0, chai_1.expect)(files).to.have.lengthOf(1);
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 2:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 3:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(0);
(0, chai_1.expect)(files).to.have.lengthOf(0);
return [2 /*return*/];

@@ -99,3 +97,3 @@ }

}); });
it('list', function () { return __awaiter(_this, void 0, void 0, function () {
it('list', function () { return __awaiter(void 0, void 0, void 0, function () {
var stashes;

@@ -105,3 +103,3 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

@@ -114,3 +112,3 @@ case 1:

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(1);
(0, chai_1.expect)(stashes).to.have.lengthOf(1);
return [2 /*return*/];

@@ -120,3 +118,3 @@ }

}); });
it('apply latest', function () { return __awaiter(_this, void 0, void 0, function () {
it('apply latest', function () { return __awaiter(void 0, void 0, void 0, function () {
var afterStatus, files;

@@ -126,7 +124,7 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

@@ -138,8 +136,8 @@ case 2:

_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(test_helper_1.contentIsEqual(repositoryPath, files[0].path, testText)).to.equal(true);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)((0, test_helper_1.contentIsEqual)(repositoryPath, files[0].path, testText)).to.equal(true);
return [2 /*return*/];

@@ -149,3 +147,3 @@ }

}); });
it('stash with a message', function () { return __awaiter(_this, void 0, void 0, function () {
it('stash with a message', function () { return __awaiter(void 0, void 0, void 0, function () {
var afterStatus, files, stashes;

@@ -155,15 +153,15 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 3:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(0);
(0, chai_1.expect)(files).to.have.lengthOf(0);
stashes = [];

@@ -173,4 +171,4 @@ return [4 /*yield*/, stash_1.stash.list(repositoryPath)];

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(2);
chai_1.expect(stashes[0]).contains('This is a stash message.');
(0, chai_1.expect)(stashes).to.have.lengthOf(2);
(0, chai_1.expect)(stashes[0]).contains('This is a stash message.');
return [2 /*return*/];

@@ -180,3 +178,3 @@ }

}); });
it('apply by id', function () { return __awaiter(_this, void 0, void 0, function () {
it('apply by id', function () { return __awaiter(void 0, void 0, void 0, function () {
var afterStatus, files;

@@ -186,7 +184,7 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];

@@ -198,8 +196,8 @@ case 2:

_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 4:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(test_helper_1.contentIsEqual(repositoryPath, files[0].path, testText)).to.equal(true);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)((0, test_helper_1.contentIsEqual)(repositoryPath, files[0].path, testText)).to.equal(true);
return [2 /*return*/];

@@ -209,3 +207,3 @@ }

}); });
it('pop latest', function () { return __awaiter(_this, void 0, void 0, function () {
it('pop latest', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_1, afterStatus, files, stashes;

@@ -215,11 +213,11 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
_a.label = 3;

@@ -231,7 +229,7 @@ case 3:

_a.sent();
assert_1.fail();
(0, assert_1.fail)();
return [3 /*break*/, 11];
case 5:
error_1 = _a.sent();
chai_1.expect(error_1.message).contains('Your local changes to the following files would be overwritten');
(0, chai_1.expect)(error_1.message).contains('Your local changes to the following files would be overwritten');
return [3 /*break*/, 11];

@@ -244,12 +242,12 @@ case 6: return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 9:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(test_helper_1.contentIsEqual(repositoryPath, files[0].path, testText2)).to.equal(true);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)((0, test_helper_1.contentIsEqual)(repositoryPath, files[0].path, testText2)).to.equal(true);
return [4 /*yield*/, stash_1.stash.list(repositoryPath)];
case 10:
stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(2);
(0, chai_1.expect)(stashes).to.have.lengthOf(2);
return [7 /*endfinally*/];

@@ -260,3 +258,3 @@ case 11: return [2 /*return*/];

}); });
it('pop by id', function () { return __awaiter(_this, void 0, void 0, function () {
it('pop by id', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_2, afterStatus, files, stashes;

@@ -266,11 +264,11 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
_a.label = 3;

@@ -282,7 +280,7 @@ case 3:

_a.sent();
assert_1.fail();
(0, assert_1.fail)();
return [3 /*break*/, 11];
case 5:
error_2 = _a.sent();
chai_1.expect(error_2.message).contains('Your local changes to the following files would be overwritten');
(0, chai_1.expect)(error_2.message).contains('Your local changes to the following files would be overwritten');
return [3 /*break*/, 11];

@@ -295,12 +293,12 @@ case 6: return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

_a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 9:
afterStatus = _a.sent();
files = afterStatus.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(test_helper_1.contentIsEqual(repositoryPath, files[0].path, testText2)).to.equal(true);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)((0, test_helper_1.contentIsEqual)(repositoryPath, files[0].path, testText2)).to.equal(true);
return [4 /*yield*/, stash_1.stash.list(repositoryPath)];
case 10:
stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(2);
(0, chai_1.expect)(stashes).to.have.lengthOf(2);
return [7 /*endfinally*/];

@@ -311,3 +309,3 @@ case 11: return [2 /*return*/];

}); });
it('drop latest', function () { return __awaiter(_this, void 0, void 0, function () {
it('drop latest', function () { return __awaiter(void 0, void 0, void 0, function () {
var stashes;

@@ -317,11 +315,11 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

@@ -336,3 +334,3 @@ case 3:

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(2);
(0, chai_1.expect)(stashes).to.have.lengthOf(2);
return [2 /*return*/];

@@ -342,3 +340,3 @@ }

}); });
it('drop by id', function () { return __awaiter(_this, void 0, void 0, function () {
it('drop by id', function () { return __awaiter(void 0, void 0, void 0, function () {
var stashes;

@@ -348,11 +346,11 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

@@ -367,3 +365,3 @@ case 3:

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(2);
(0, chai_1.expect)(stashes).to.have.lengthOf(2);
return [2 /*return*/];

@@ -373,3 +371,3 @@ }

}); });
it('clear', function () { return __awaiter(_this, void 0, void 0, function () {
it('clear', function () { return __awaiter(void 0, void 0, void 0, function () {
var stashes;

@@ -379,11 +377,11 @@ return __generator(this, function (_a) {

case 0:
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];
case 1:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: testText2 });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: testText2 });
return [4 /*yield*/, stash_1.stash.push(repositoryPath, 'This is a stash message.')];
case 2:
_a.sent();
test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'B' });
(0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'B' });
return [4 /*yield*/, stash_1.stash.push(repositoryPath)];

@@ -395,3 +393,3 @@ case 3:

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(3);
(0, chai_1.expect)(stashes).to.have.lengthOf(3);
return [4 /*yield*/, stash_1.stash.clear(repositoryPath)];

@@ -403,3 +401,3 @@ case 5:

stashes = _a.sent();
chai_1.expect(stashes).to.have.lengthOf(0);
(0, chai_1.expect)(stashes).to.have.lengthOf(0);
return [2 /*return*/];

@@ -406,0 +404,0 @@ }

@@ -0,0 +0,0 @@ import { IGitExecutionOptions } from '../core/git';

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -53,6 +54,6 @@ });

};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
return {
if (o && typeof o.length === "number") return {
next: function () {

@@ -63,4 +64,6 @@ if (o && i >= o.length) o = void 0;

};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStatus = void 0;
var git_1 = require("../core/git");

@@ -126,3 +129,3 @@ var status_parser_1 = require("../parser/status-parser");

_d.trys.push([1, 3, , 4]);
return [4 /*yield*/, git_1.gitVersion(options)];
return [4 /*yield*/, (0, git_1.gitVersion)(options)];
case 2:

@@ -165,3 +168,3 @@ version = _d.sent();

args.push('status', '--untracked-files=all', '--branch', '--porcelain=2', '-z');
return [4 /*yield*/, git_1.git(args, repositoryPath, 'getStatus', options)];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'getStatus', options)];
case 7:

@@ -175,6 +178,6 @@ result = _d.sent();

branchAheadBehind = undefined;
_b = status_parser_1.parsePorcelainStatus(result.stdout, limit), entries = _b.entries, incomplete = _b.incomplete;
_b = (0, status_parser_1.parsePorcelainStatus)(result.stdout, limit), entries = _b.entries, incomplete = _b.incomplete;
_loop_1 = function (entry) {
if (entry.kind === 'entry') {
var status = status_parser_1.mapStatus(entry.statusCode);
var status = (0, status_parser_1.mapStatus)(entry.statusCode);
if (status.kind === 'ordinary') {

@@ -181,0 +184,0 @@ // when a file is added in the index but then removed in the working

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,3 +38,2 @@ });

};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -50,5 +50,4 @@ var temp = require("temp");

var track = temp.track();
describe('status', function () { return __awaiter(_this, void 0, void 0, function () {
describe('status', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryWithChanges;
var _this = this;
return __generator(this, function (_a) {

@@ -66,3 +65,3 @@ repositoryWithChanges = path.join(os.homedir(), '.git');

}
return [4 /*yield*/, clone_1.clone('https://github.com/eclipse/xtext-core.git', repositoryWithChanges)];
return [4 /*yield*/, (0, clone_1.clone)('https://github.com/eclipse/xtext-core.git', repositoryWithChanges)];
case 1:

@@ -82,3 +81,3 @@ _a.sent();

});
after(function () { return __awaiter(_this, void 0, void 0, function () {
after(function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -90,3 +89,3 @@ track.cleanupSync();

}); });
it('missing', function () { return __awaiter(_this, void 0, void 0, function () {
it('missing', function () { return __awaiter(void 0, void 0, void 0, function () {
var error_1;

@@ -97,3 +96,3 @@ return __generator(this, function (_a) {

_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, status_1.getStatus('/does/not/exist')];
return [4 /*yield*/, (0, status_1.getStatus)('/does/not/exist')];
case 1:

@@ -104,3 +103,3 @@ _a.sent();

error_1 = _a.sent();
chai_1.expect(error_1.message).to.be.equal('Unable to find path to repository on disk.');
(0, chai_1.expect)(error_1.message).to.be.equal('Unable to find path to repository on disk.');
return [3 /*break*/, 3];

@@ -111,13 +110,13 @@ case 3: return [2 /*return*/];

}); });
it('empty', function () { return __awaiter(_this, void 0, void 0, function () {
it('empty', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, status;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
status = _a.sent();
chai_1.expect(status.workingDirectory.files).to.be.empty;
(0, chai_1.expect)(status.workingDirectory.files).to.be.empty;
return [2 /*return*/];

@@ -127,17 +126,17 @@ }

}); });
it('new', function () { return __awaiter(_this, void 0, void 0, function () {
it('new', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, status, files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.add(repositoryPath, { path: 'X.txt' });
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.add)(repositoryPath, { path: 'X.txt' });
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
status = _a.sent();
files = status.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.New);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.New);
return [2 /*return*/];

@@ -147,17 +146,17 @@ }

}); });
it('deleted', function () { return __awaiter(_this, void 0, void 0, function () {
it('deleted', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, status, files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.remove(repositoryPath, 'A.txt');
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.remove)(repositoryPath, 'A.txt');
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
status = _a.sent();
files = status.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Deleted);
return [2 /*return*/];

@@ -167,17 +166,17 @@ }

}); });
it('modified', function () { return __awaiter(_this, void 0, void 0, function () {
it('modified', function () { return __awaiter(void 0, void 0, void 0, function () {
var repositoryPath, filePaths, status, files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, test_helper_1.createTestRepository(track.mkdirSync())];
case 0: return [4 /*yield*/, (0, test_helper_1.createTestRepository)(track.mkdirSync())];
case 1:
repositoryPath = _a.sent();
filePaths = test_helper_1.modify(repositoryPath, { path: 'A.txt', data: 'content' });
return [4 /*yield*/, status_1.getStatus(repositoryPath)];
filePaths = (0, test_helper_1.modify)(repositoryPath, { path: 'A.txt', data: 'content' });
return [4 /*yield*/, (0, status_1.getStatus)(repositoryPath)];
case 2:
status = _a.sent();
files = status.workingDirectory.files;
chai_1.expect(files).to.have.lengthOf(1);
chai_1.expect(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
chai_1.expect(files[0].status).to.be.equal(status_2.FileStatus.Modified);
(0, chai_1.expect)(files).to.have.lengthOf(1);
(0, chai_1.expect)(files[0].path).to.be.equal(path.relative(repositoryPath, filePaths[0]));
(0, chai_1.expect)(files[0].status).to.be.equal(status_2.FileStatus.Modified);
return [2 /*return*/];

@@ -194,7 +193,7 @@ }

this.timeout(1000);
return [4 /*yield*/, status_1.getStatus(repositoryWithChanges)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryWithChanges)];
case 1:
status = _a.sent();
chai_1.expect(status.workingDirectory.files.length > 10000);
chai_1.expect(!!status.incomplete).to.be.false;
(0, chai_1.expect)(status.workingDirectory.files.length > 10000);
(0, chai_1.expect)(!!status.incomplete).to.be.false;
return [2 /*return*/];

@@ -212,7 +211,7 @@ }

this.timeout(1000);
return [4 /*yield*/, status_1.getStatus(repositoryWithChanges, false, 500)];
return [4 /*yield*/, (0, status_1.getStatus)(repositoryWithChanges, false, 500)];
case 1:
status = _a.sent();
chai_1.expect(status.workingDirectory.files.length === 500);
chai_1.expect(status.incomplete).to.be.true;
(0, chai_1.expect)(status.workingDirectory.files.length === 500);
(0, chai_1.expect)(status.incomplete).to.be.true;
return [2 /*return*/];

@@ -219,0 +218,0 @@ }

@@ -0,0 +0,0 @@ /**

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,6 +38,6 @@ });

};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
return {
if (o && typeof o.length === "number") return {
next: function () {

@@ -47,2 +48,3 @@ if (o && i >= o.length) o = void 0;

};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};

@@ -65,7 +67,13 @@ var __read = (this && this.__read) || function (o, n) {

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.contentIsEqual = exports.rename = exports.modify = exports.add = exports.remove = exports.usesLocalGit = exports.createTestRepository = exports.initRepository = void 0;
var path = require("path");

@@ -85,3 +93,3 @@ var fs = require("fs-extra");

switch (_a.label) {
case 0: return [4 /*yield*/, git_1.git(['init'], path, 'init')];
case 0: return [4 /*yield*/, (0, git_1.git)(['init'], path, 'init')];
case 1:

@@ -91,3 +99,3 @@ if ((_a.sent()).exitCode !== 0) {

}
return [4 /*yield*/, git_1.git(['config', 'user.email', '"jon@doe.com"'], path, 'config')];
return [4 /*yield*/, (0, git_1.git)(['config', 'user.email', '"jon@doe.com"'], path, 'config')];
case 2:

@@ -97,3 +105,3 @@ if ((_a.sent()).exitCode !== 0) {

}
return [4 /*yield*/, git_1.git(['config', 'user.name', '"Jon Doe"'], path, 'config')];
return [4 /*yield*/, (0, git_1.git)(['config', 'user.name', '"Jon Doe"'], path, 'config')];
case 3:

@@ -103,3 +111,3 @@ if ((_a.sent()).exitCode !== 0) {

}
return [4 /*yield*/, git_1.git(['config', 'core.autocrlf', 'false'], path, 'config')];
return [4 /*yield*/, (0, git_1.git)(['config', 'core.autocrlf', 'false'], path, 'config')];
case 4:

@@ -112,3 +120,3 @@ // To make sure we have `\n` as the line ending on both Windows and *NIX when asserting the tests.

if (!add) return [3 /*break*/, 7];
return [4 /*yield*/, git_1.git(['add', '.'], path, 'add')];
return [4 /*yield*/, (0, git_1.git)(['add', '.'], path, 'add')];
case 5:

@@ -119,3 +127,3 @@ if ((_a.sent()).exitCode !== 0) {

if (!commit) return [3 /*break*/, 7];
return [4 /*yield*/, git_1.git(['commit', '-F', '-'], path, 'createCommit', { stdin: 'Initial commit.' })];
return [4 /*yield*/, (0, git_1.git)(['commit', '-F', '-'], path, 'createCommit', { stdin: 'Initial commit.' })];
case 6:

@@ -273,3 +281,3 @@ if ((_a.sent()).exitCode !== 0) {

}
return __spread(files.map(function (f) { return f.oldPath; }), files.map(function (f) { return f.newPath; }));
return __spreadArray(__spreadArray([], __read(files.map(function (f) { return f.oldPath; })), false), __read(files.map(function (f) { return f.newPath; })), false);
}

@@ -276,0 +284,0 @@ exports.rename = rename;

@@ -0,0 +0,0 @@ import { WorkingDirectoryFileChange } from '../model/status';

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,6 +38,6 @@ });

};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
return {
if (o && typeof o.length === "number") return {
next: function () {

@@ -47,4 +48,6 @@ if (o && i >= o.length) o = void 0;

};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.stageFiles = void 0;
var git_1 = require("../core/git");

@@ -86,3 +89,3 @@ var diff_1 = require("../model/diff");

args.push('-z', '--stdin');
return [4 /*yield*/, git_1.git(args, repositoryPath, 'updateIndex', { stdin: paths.join('\0') })];
return [4 /*yield*/, (0, git_1.git)(args, repositoryPath, 'updateIndex', { stdin: paths.join('\0') })];
case 1:

@@ -195,3 +198,3 @@ _a.sent();

file = partial_1_1.value;
return [4 /*yield*/, apply_1.applyPatchToIndex(repositoryPath, file)];
return [4 /*yield*/, (0, apply_1.applyPatchToIndex)(repositoryPath, file)];
case 5:

@@ -198,0 +201,0 @@ _c.sent();

@@ -0,0 +0,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeRemotePrefix = void 0;
/**

@@ -4,0 +5,0 @@ * Remove the remote prefix from the string. If there is no prefix, returns

@@ -0,0 +0,0 @@ import { IGitResult as DugiteResult, GitError as DugiteError, IGitExecutionOptions as DugiteExecutionOptions } from 'dugite-no-gpl';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -28,6 +30,7 @@ function __() { this.constructor = d; }

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -64,2 +67,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.gitVersion = exports.git = exports.GitError = void 0;
var fs = require("fs");

@@ -219,3 +223,3 @@ var Path = require("path");

};
opts = __assign({}, defaultOptions, options);
opts = __assign(__assign({}, defaultOptions), options);
result = void 0;

@@ -248,3 +252,3 @@ if (!(options && options.exec)) return [3 /*break*/, 4];

gitErrorDescription = gitError ? getDescriptionForError(gitError) : undefined;
gitResult = __assign({}, result, { gitError: gitError, gitErrorDescription: gitErrorDescription });
gitResult = __assign(__assign({}, result), { gitError: gitError, gitErrorDescription: gitErrorDescription });
acceptableError = true;

@@ -289,3 +293,3 @@ if (gitError && opts.expectedErrors) {

}
return [4 /*yield*/, find_git_exec_2.default()];
return [4 /*yield*/, (0, find_git_exec_2.default)()];
case 1:

@@ -367,3 +371,3 @@ gitPath = _a.sent();

_a.trys.push([1, 3, 4, 5]);
return [4 /*yield*/, find_git_exec_1.default()];
return [4 /*yield*/, (0, find_git_exec_1.default)()];
case 2:

@@ -370,0 +374,0 @@ git_1 = _a.sent();

@@ -9,8 +9,8 @@ "use strict";

var node_modules = path.join(__dirname, '..', '..', 'node_modules');
chai_1.expect(fs.existsSync(node_modules)).to.be.true;
chai_1.expect(fs.existsSync(path.join(node_modules, 'dugite'))).to.be.false;
chai_1.expect(fs.existsSync(path.join(node_modules, 'dugite-no-gpl'))).to.be.true;
chai_1.expect(fs.existsSync(path.join(node_modules, 'dugite-no-gpl', 'git'))).to.be.false;
(0, chai_1.expect)(fs.existsSync(node_modules)).to.be.true;
(0, chai_1.expect)(fs.existsSync(path.join(node_modules, 'dugite'))).to.be.false;
(0, chai_1.expect)(fs.existsSync(path.join(node_modules, 'dugite-no-gpl'))).to.be.true;
(0, chai_1.expect)(fs.existsSync(path.join(node_modules, 'dugite-no-gpl', 'git'))).to.be.false;
});
});
//# sourceMappingURL=git.spec.js.map
export * from './git';
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./git"));
__exportStar(require("./git"), exports);
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ export * from './command/index';

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./command/index"));
__export(require("./core/index"));
__export(require("./model/index"));
__export(require("./parser/index"));
__export(require("./progress/index"));
__exportStar(require("./command/index"), exports);
__exportStar(require("./core/index"), exports);
__exportStar(require("./model/index"), exports);
__exportStar(require("./parser/index"), exports);
__exportStar(require("./progress/index"), exports);
//# sourceMappingURL=index.js.map

@@ -18,7 +18,7 @@ import { Commit } from './commit';

/** The name of the upstream's remote. */
readonly remote: string | undefined;
get remote(): string | undefined;
/**
* The name of the branch's upstream without the remote prefix.
*/
readonly upstreamWithoutRemote: string | undefined;
get upstreamWithoutRemote(): string | undefined;
/**

@@ -28,3 +28,3 @@ * The name of the branch without the remote prefix. If the branch is a local

*/
readonly nameWithoutRemote: string;
get nameWithoutRemote(): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Branch = exports.BranchType = void 0;
var api_1 = require("../core/api");

@@ -32,3 +33,3 @@ // NOTE: The values here matter as they are used to sort

},
enumerable: true,
enumerable: false,
configurable: true

@@ -44,5 +45,5 @@ });

}
return api_1.removeRemotePrefix(this.upstream);
return (0, api_1.removeRemotePrefix)(this.upstream);
},
enumerable: true,
enumerable: false,
configurable: true

@@ -60,7 +61,7 @@ });

else {
var withoutRemote = api_1.removeRemotePrefix(this.name);
var withoutRemote = (0, api_1.removeRemotePrefix)(this.name);
return withoutRemote || this.name;
}
},
enumerable: true,
enumerable: false,
configurable: true

@@ -67,0 +68,0 @@ });

@@ -0,0 +0,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommitIdentity = void 0;
/**

@@ -4,0 +5,0 @@ * A tuple of name, email, and date for the author or commit

@@ -0,0 +0,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommitIdentity = void 0;
var CommitIdentity;

@@ -4,0 +5,0 @@ (function (CommitIdentity) {

@@ -112,3 +112,3 @@ export declare enum DiffType {

/** An ID for the file change. */
readonly id: string;
get id(): string;
}

@@ -115,0 +115,0 @@ /** the contents of a diff generated by Git */

@@ -18,7 +18,13 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiffSelection = exports.DiffSelectionType = exports.FileSummary = exports.Image = exports.DiffHunk = exports.DiffHunkHeader = exports.DiffLine = exports.DiffLineType = exports.DiffType = void 0;
var DiffType;

@@ -104,3 +110,3 @@ (function (DiffType) {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -177,3 +183,3 @@ });

if (selectableLines && selectableLines.size === divergingLines.size) {
var allSelectableLinesAreDivergent = __spread(selectableLines).every(function (i) { return divergingLines.has(i); });
var allSelectableLinesAreDivergent = __spreadArray([], __read(selectableLines), false).every(function (i) { return divergingLines.has(i); });
if (allSelectableLinesAreDivergent) {

@@ -317,3 +323,3 @@ return this.defaultSelectionType === DiffSelectionType.All

var divergingLines = this.divergingLines
? new Set(__spread(this.divergingLines).filter(function (x) { return selectableLines.has(x); }))
? new Set(__spreadArray([], __read(this.divergingLines), false).filter(function (x) { return selectableLines.has(x); }))
: null;

@@ -320,0 +326,0 @@ return new DiffSelection(this.defaultSelectionType, divergingLines, selectableLines);

@@ -0,0 +0,0 @@ export * from './branch';

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./branch"));
__export(require("./commit"));
__export(require("./diff"));
__export(require("./status"));
__exportStar(require("./branch"), exports);
__exportStar(require("./commit"), exports);
__exportStar(require("./diff"), exports);
__exportStar(require("./status"), exports);
//# sourceMappingURL=index.js.map

@@ -113,3 +113,3 @@ import { DiffSelection } from './diff';

/** An ID for the file change. */
readonly id: string;
get id(): string;
}

@@ -116,0 +116,0 @@ /** encapsulate the changes to a file in the working directory */

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkingDirectoryStatus = exports.WorkingDirectoryFileChange = exports.FileChange = exports.FileStatus = exports.AppFileStatus = exports.GitStatusEntry = void 0;
/**

@@ -91,3 +94,3 @@ * The status entry code as reported by Git.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -94,0 +97,0 @@ });

@@ -0,0 +0,0 @@ import { IRawDiff } from '../model/diff';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiffParser = void 0;
var diff_1 = require("../model/diff");

@@ -4,0 +5,0 @@ // https://en.wikipedia.org/wiki/Diff_utility

export * from './diff-parser';
export * from './patch-formatter';
export * from './status-parser';
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./diff-parser"));
__export(require("./patch-formatter"));
__export(require("./status-parser"));
__exportStar(require("./diff-parser"), exports);
__exportStar(require("./patch-formatter"), exports);
__exportStar(require("./status-parser"), exports);
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import { WorkingDirectoryFileChange } from '../model/status';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatPatch = void 0;
var status_1 = require("../model/status");

@@ -4,0 +5,0 @@ var diff_1 = require("../model/diff");

@@ -0,0 +0,0 @@ import { FileEntry } from '../model/status';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapStatus = exports.parsePorcelainStatus = void 0;
var status_1 = require("../model/status");

@@ -4,0 +5,0 @@ var ChangedEntryType = '1';

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckoutProgressParser = void 0;
var git_1 = require("./git");

@@ -19,0 +22,0 @@ var steps = [

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.CloneProgressParser = void 0;
var git_1 = require("./git");

@@ -19,0 +22,0 @@ /**

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.FetchProgressParser = void 0;
var git_1 = require("./git");

@@ -19,0 +22,0 @@ /**

@@ -0,0 +0,0 @@ /// <reference types="node" />

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.progressProcessCallback = exports.executionOptionsWithProgress = void 0;
var byline = require('byline');

@@ -4,0 +5,0 @@ /**

@@ -0,0 +0,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = exports.GitProgressParser = void 0;
/**

@@ -4,0 +5,0 @@ * A utility class for interpreting progress output from `git`

@@ -0,0 +0,0 @@ export * from './checkout';

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./checkout"));
__export(require("./clone"));
__export(require("./fetch"));
__export(require("./from-process"));
__export(require("./git"));
__export(require("./pull"));
__export(require("./push"));
__exportStar(require("./checkout"), exports);
__exportStar(require("./clone"), exports);
__exportStar(require("./fetch"), exports);
__exportStar(require("./from-process"), exports);
__exportStar(require("./git"), exports);
__exportStar(require("./pull"), exports);
__exportStar(require("./push"), exports);
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.PullProgressParser = void 0;
var git_1 = require("./git");

@@ -19,0 +22,0 @@ /**

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git';

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.PushProgressParser = void 0;
var git_1 = require("./git");

@@ -19,0 +22,0 @@ /**

{
"name": "dugite-extra",
"version": "0.1.14",
"version": "0.1.15",
"description": "High-level Git commands for dugite.",

@@ -8,10 +8,10 @@ "main": "lib/index",

"engines": {
"node": ">=10.11.0 <13"
"node": ">=10.11.0"
},
"scripts": {
"build": "tsc && tslint -c ./tslint.json --project ./tsconfig.json",
"test": "cross-env USE_LOCAL_GIT=true mocha --opts ./mocha.opts src/**/*.spec.ts",
"prepare": "yarn run build && yarn run test",
"test:watch": "cross-env USE_LOCAL_GIT=true mocha -w --opts ./mocha.opts src/**/*.spec.ts",
"test:ssh": "cross-env GIT_OVER_SSH_TEST=true mocha --opts ./mocha.opts src/**/*.spec.ts",
"test": "cross-env USE_LOCAL_GIT=true mocha src/**/*.spec.ts",
"prepare": "npm run build && npm run test",
"test:watch": "cross-env USE_LOCAL_GIT=true mocha -w src/**/*.spec.ts",
"test:ssh": "cross-env GIT_OVER_SSH_TEST=true mocha src/**/*.spec.ts",
"clean": "rimraf ./lib",

@@ -38,24 +38,24 @@ "build:watch": "tsc -w",

"dugite-no-gpl": "1.69.0",
"find-git-exec": "^0.0.3",
"upath": "^1.0.0"
"find-git-exec": "^0.0.4",
"upath": "^2.0.1"
},
"devDependencies": {
"@types/chai": "^4.2.5",
"@types/fs-extra": "^4.0.2",
"@types/mocha": "^5.2.7",
"@types/node": "^7.0.22",
"@types/temp": "^0.8.34",
"chai": "^4.2.0",
"concurrently": "^5.0.0",
"cross-env": "^6.0.3",
"fs-extra": "^4.0.2",
"mocha": "^6.2.2",
"node-ssh": "^6.0.0",
"@types/chai": "^4.2.22",
"@types/fs-extra": "^9.0.13",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.6",
"@types/temp": "^0.9.1",
"chai": "^4.3.4",
"concurrently": "^6.3.0",
"cross-env": "^7.0.3",
"fs-extra": "^10.0.0",
"mocha": "9.1.3",
"node-ssh": "^12.0.1",
"rimraf": "^3.0.0",
"temp": "^0.9.1",
"ts-node": "^8.5.2",
"tslint": "^5.20.1",
"temp": "^0.9.4",
"ts-node": "^10.4.0",
"tslint": "^6.1.3",
"tslint-no-unused-expression-chai": "^0.1.4",
"typescript": "~3.5.3"
"typescript": "~4.4.4"
}
}

@@ -9,4 +9,4 @@ # dugite-extra

"engines": {
"node": ">=10.11.0 <13"
"node": ">=10.11.0"
},
```

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from '../core/git'

@@ -75,4 +75,4 @@ import * as temp from 'temp';

expect(localBranches.length).to.be.equal(2);
expect(localBranches[0].name).to.be.equal('master');
expect(localBranches[1].name).to.be.equal(newBranch);
expect(localBranches[1].name).to.be.equal('master');
expect(localBranches[0].name).to.be.equal(newBranch);

@@ -92,4 +92,4 @@ const currentBranch = await listBranch(path, 'current');

expect(localBranches.length).to.be.equal(2);
expect(localBranches[0].name).to.be.equal('master');
expect(localBranches[1].name).to.be.equal(newBranch);
expect(localBranches[1].name).to.be.equal('master');
expect(localBranches[0].name).to.be.equal(newBranch);

@@ -96,0 +96,0 @@ const currentBranch = await listBranch(path, 'current');

@@ -105,3 +105,3 @@ import { git, IGitExecutionOptions } from '../core/git';

// Preceding newline character after first row.
const pieces = (ix > 0 ? line.substr(1) : line).split('\0');
const pieces = (ix > 0 ? line.substring(1) : line).split('\0');

@@ -108,0 +108,0 @@ const ref = pieces[0];

@@ -0,0 +0,0 @@ import * as Path from 'path';

@@ -0,0 +0,0 @@ import * as temp from 'temp';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from '../core/git'

@@ -0,0 +0,0 @@ import * as temp from 'temp';

@@ -0,0 +0,0 @@ import { git, GitError, IGitExecutionOptions } from '../core/git'

@@ -0,0 +0,0 @@ import * as Path from 'path';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from '../core/git';

@@ -0,0 +0,0 @@ export * from './apply';

@@ -0,0 +0,0 @@ import * as fs from 'fs';

@@ -0,0 +0,0 @@ import * as Path from 'path';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from '../core/git';

@@ -0,0 +0,0 @@ import { git, GitError, IGitExecutionOptions } from '../core/git';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions, GitError } from '../core/git';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from '../core/git';

@@ -0,0 +0,0 @@ import * as fs from 'fs';

@@ -9,4 +9,4 @@ import { relative } from 'path';

const successExitCodes = new Set([0, 1]);
const utf8Encoding: (process: ChildProcess) => void = cb => cb.stdout.setEncoding('utf8');
const binaryEncoding: (process: ChildProcess) => void = cb => cb.stdout.setEncoding('binary');
const utf8Encoding: (process: ChildProcess) => void = cb => cb.stdout?.setEncoding('utf8');
const binaryEncoding: (process: ChildProcess) => void = cb => cb.stdout?.setEncoding('binary');

@@ -57,2 +57,2 @@ /**

return Buffer.from(blobContents.stdout, 'binary');
}
}

@@ -200,3 +200,4 @@ import * as path from 'path';

it('reverting the state in the working tree should not modify the index state', async () => {
xit('reverting the state in the working tree should not modify the index state', async () => {
const repositoryPath = await createTestRepository(track.mkdirSync());

@@ -203,0 +204,0 @@

@@ -0,0 +0,0 @@ import * as path from 'path';

@@ -0,0 +0,0 @@ import * as temp from 'temp';

@@ -0,0 +0,0 @@ import { git, IGitExecutionOptions } from "../core";

@@ -0,0 +0,0 @@ import * as temp from 'temp';

@@ -0,0 +0,0 @@ import { git, gitVersion, IGitExecutionOptions } from '../core/git';

@@ -0,0 +0,0 @@ import * as path from 'path';

@@ -0,0 +0,0 @@ import { git } from '../core/git';

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ import * as fs from 'fs';

@@ -0,0 +0,0 @@ import * as fs from 'fs';

export * from './git';

@@ -0,0 +0,0 @@ export * from './command/index';

@@ -0,0 +0,0 @@ import { Commit } from './commit'

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ export enum DiffType {

@@ -0,0 +0,0 @@ export * from './branch';

@@ -0,0 +0,0 @@ import { DiffSelection } from './diff';

@@ -0,0 +0,0 @@ import { IRawDiff, DiffHunk, DiffHunkHeader, DiffLine, DiffLineType } from '../model/diff'

export * from './diff-parser';
export * from './patch-formatter';
export * from './status-parser';

@@ -0,0 +0,0 @@ import { WorkingDirectoryFileChange, AppFileStatus } from '../model/status'

@@ -0,0 +0,0 @@ import { FileEntry, GitStatusEntry } from '../model/status'

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git'

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git'

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git'

@@ -0,0 +0,0 @@ import { ChildProcess } from 'child_process'

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ export * from './checkout'

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git'

@@ -0,0 +0,0 @@ import { GitProgressParser } from './git'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc