do not set default command for scm

This commit is contained in:
oleg 2016-02-28 22:13:24 +03:00
parent f721de039d
commit baceedd70e
4 changed files with 12 additions and 8 deletions

View File

@ -6,7 +6,7 @@ var Steppy = require('twostep').Steppy,
createScm = require('../scm').createScm,
createCommand = require('../command').createCommand,
fs = require('fs'),
_ = require('underscore');
SpawnCommand = require('../command/spawn').Command;
function Executor(params) {
ParentExecutor.call(this, params);
@ -17,6 +17,8 @@ inherits(Executor, ParentExecutor);
exports.Executor = Executor;
Executor.prototype._createScm = function(params) {
params.command = new SpawnCommand();
return createScm(params);
};

View File

@ -18,6 +18,8 @@ function Scm(params) {
self.command = params.command;
if (!self.command) throw new Error('`command` is required');
self.command.setParams({
collectOut: true,
emitIn: true,

View File

@ -1,11 +1,6 @@
'use strict';
var SpawnCommand = require('../command/spawn').Command;
exports.createScm = function(params) {
var Constructor = require('./' + params.type).Scm;
params.command = params.command || new SpawnCommand();
return new Constructor(params);
};

View File

@ -42,7 +42,8 @@ var expect = require('expect.js'),
it('create scm instance attached to new repository without errors', function() {
scm = createScm({
type: type,
repository: originalRepositoryPath
repository: originalRepositoryPath,
command: new SpawnCommand()
});
});
@ -129,7 +130,11 @@ var expect = require('expect.js'),
});
it('create scm instance attached to existing `cwd` without errors', function() {
scm = createScm({type: type, cwd: repositoryPath});
scm = createScm({
type: type,
cwd: repositoryPath,
command: new SpawnCommand()
});
});
it('expect repository log from rev0 to default revision equals to ' +