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

View File

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

View File

@ -1,11 +1,6 @@
'use strict'; 'use strict';
var SpawnCommand = require('../command/spawn').Command;
exports.createScm = function(params) { exports.createScm = function(params) {
var Constructor = require('./' + params.type).Scm; var Constructor = require('./' + params.type).Scm;
params.command = params.command || new SpawnCommand();
return new Constructor(params); 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() { it('create scm instance attached to new repository without errors', function() {
scm = createScm({ scm = createScm({
type: type, 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() { 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 ' + it('expect repository log from rev0 to default revision equals to ' +