YES AWESOME got make origin working with headless somehow in crazy

This commit is contained in:
Peter Cottle 2013-10-06 16:33:30 -07:00
parent c0e395ad35
commit 0c95e975ec
2 changed files with 74 additions and 2 deletions

View file

@ -43,6 +43,25 @@ function getMockFactory() {
return mockFactory;
}
function getMockVisualization() {
return {
makeOrigin: function(options) {
var localRepo = options.localRepo;
var treeString = options.treeString;
var headless = new HeadlessGit();
return {
customEvents: {
on: function(key, cb, context) {
cb.apply(context, []);
}
},
gitEngine: headless.gitEngine
};
}
};
}
var HeadlessGit = function() {
this.init();
};
@ -55,6 +74,11 @@ HeadlessGit.prototype.init = function() {
// is headless
var animationFactory = getMockFactory();
var gitVisuals = mock(GitVisuals);
// add some stuff for origin making
var mockVis = getMockVisualization();
gitVisuals.getVisualization = function() {
return mockVis;
};
this.gitEngine = new GitEngine({
collection: this.commitCollection,