mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
This commit is contained in:
parent
ebfd5e84d2
commit
aa39e1af3c
3 changed files with 16 additions and 0 deletions
|
@ -70,8 +70,10 @@ var expectTreeAsync = function(command, expectedJSON, startJSON) {
|
||||||
console.log('\n<<<<<<<<<<<\nactual', getHeadlessSummary(headless));
|
console.log('\n<<<<<<<<<<<\nactual', getHeadlessSummary(headless));
|
||||||
console.log('\n<<<<ORIGIN>>>>>\n');
|
console.log('\n<<<<ORIGIN>>>>>\n');
|
||||||
if (expected.originTree) {
|
if (expected.originTree) {
|
||||||
|
console.log('expected origin tree:');
|
||||||
console.log(expected.originTree);
|
console.log(expected.originTree);
|
||||||
console.log('\n=========\n');
|
console.log('\n=========\n');
|
||||||
|
console.log('actual origin tree');
|
||||||
console.log(getHeadlessSummary(headless).originTree);
|
console.log(getHeadlessSummary(headless).originTree);
|
||||||
}
|
}
|
||||||
console.log(expectedJSON);
|
console.log(expectedJSON);
|
||||||
|
|
11
spec/simpleRemote.spec.js
Normal file
11
spec/simpleRemote.spec.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
var base = require('./base');
|
||||||
|
var expectTreeAsync = base.expectTreeAsync;
|
||||||
|
|
||||||
|
describe('Git Remote simple', function() {
|
||||||
|
it('clones', function() {
|
||||||
|
expectTreeAsync(
|
||||||
|
'git clone',
|
||||||
|
'{"branches":{"master":{"target":"C1","id":"master","remoteTrackingBranchID":"o/master"},"o/master":{"target":"C1","id":"o/master","remoteTrackingBranchID":null}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"master","id":"HEAD"},"originTree":{"branches":{"master":{"target":"C1","id":"master","remoteTrackingBranchID":null}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"master","id":"HEAD"}}}'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
|
@ -11,6 +11,7 @@ var EventBaton = require('../util/eventBaton').EventBaton;
|
||||||
var Collections = require('../models/collections');
|
var Collections = require('../models/collections');
|
||||||
var CommitCollection = Collections.CommitCollection;
|
var CommitCollection = Collections.CommitCollection;
|
||||||
var BranchCollection = Collections.BranchCollection;
|
var BranchCollection = Collections.BranchCollection;
|
||||||
|
var TagCollection = Collections.TagCollection;
|
||||||
var Command = require('../models/commandModel').Command;
|
var Command = require('../models/commandModel').Command;
|
||||||
|
|
||||||
var mock = require('../util/mock').mock;
|
var mock = require('../util/mock').mock;
|
||||||
|
@ -70,6 +71,7 @@ var HeadlessGit = function() {
|
||||||
HeadlessGit.prototype.init = function() {
|
HeadlessGit.prototype.init = function() {
|
||||||
this.commitCollection = new CommitCollection();
|
this.commitCollection = new CommitCollection();
|
||||||
this.branchCollection = new BranchCollection();
|
this.branchCollection = new BranchCollection();
|
||||||
|
this.tagCollection = new TagCollection();
|
||||||
|
|
||||||
// here we mock visuals and animation factory so the git engine
|
// here we mock visuals and animation factory so the git engine
|
||||||
// is headless
|
// is headless
|
||||||
|
@ -84,6 +86,7 @@ HeadlessGit.prototype.init = function() {
|
||||||
this.gitEngine = new GitEngine({
|
this.gitEngine = new GitEngine({
|
||||||
collection: this.commitCollection,
|
collection: this.commitCollection,
|
||||||
branches: this.branchCollection,
|
branches: this.branchCollection,
|
||||||
|
tags: this.tagCollection,
|
||||||
gitVisuals: gitVisuals,
|
gitVisuals: gitVisuals,
|
||||||
animationFactory: animationFactory,
|
animationFactory: animationFactory,
|
||||||
eventBaton: new EventBaton()
|
eventBaton: new EventBaton()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue