diff --git a/spec/base.js b/spec/base.js index 2457adc3..e8cf1095 100644 --- a/spec/base.js +++ b/spec/base.js @@ -70,8 +70,10 @@ var expectTreeAsync = function(command, expectedJSON, startJSON) { console.log('\n<<<<<<<<<<<\nactual', getHeadlessSummary(headless)); console.log('\n<<<>>>>\n'); if (expected.originTree) { + console.log('expected origin tree:'); console.log(expected.originTree); console.log('\n=========\n'); + console.log('actual origin tree'); console.log(getHeadlessSummary(headless).originTree); } console.log(expectedJSON); diff --git a/spec/simpleRemote.spec.js b/spec/simpleRemote.spec.js new file mode 100644 index 00000000..247572b6 --- /dev/null +++ b/spec/simpleRemote.spec.js @@ -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"}}}' + ); + }); +}); diff --git a/src/js/git/headless.js b/src/js/git/headless.js index e0fe31a4..57a3e1b1 100644 --- a/src/js/git/headless.js +++ b/src/js/git/headless.js @@ -11,6 +11,7 @@ var EventBaton = require('../util/eventBaton').EventBaton; var Collections = require('../models/collections'); var CommitCollection = Collections.CommitCollection; var BranchCollection = Collections.BranchCollection; +var TagCollection = Collections.TagCollection; var Command = require('../models/commandModel').Command; var mock = require('../util/mock').mock; @@ -70,6 +71,7 @@ var HeadlessGit = function() { HeadlessGit.prototype.init = function() { this.commitCollection = new CommitCollection(); this.branchCollection = new BranchCollection(); + this.tagCollection = new TagCollection(); // here we mock visuals and animation factory so the git engine // is headless @@ -84,6 +86,7 @@ HeadlessGit.prototype.init = function() { this.gitEngine = new GitEngine({ collection: this.commitCollection, branches: this.branchCollection, + tags: this.tagCollection, gitVisuals: gitVisuals, animationFactory: animationFactory, eventBaton: new EventBaton()