@@ -64,65 +64,65 @@ exports.offset = function(test) {
6464 } ) ;
6565} ;
6666
67- exports . author = function ( test ) {
68- test . expect ( 2 ) ;
69- git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
70- repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
71- var author = commit . author ( ) ;
72- test . equals ( error , null , 'There should be no error' ) ;
73- test . notEqual ( author , null , 'Author should not be null' ) ;
74- test . done ( ) ;
75- } ) ;
76- } ) ;
77- } ;
78-
79- exports . authorName = function ( test ) {
80- test . expect ( 1 ) ;
81- git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
82- repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
83- var author = commit . author ( ) ;
84- var name = author . name ( ) ;
85- test . equals ( name , 'Michael Robinson' , 'The author name should match expected value' ) ;
86- test . done ( ) ;
87- } ) ;
88- } ) ;
89- } ;
90-
91- exports . authorEmail = function ( test ) {
92- test . expect ( 1 ) ;
93- git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
94- repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
95- var author = commit . author ( ) ;
96- var email = author . email ( ) ;
97- test . equals ( email , 'mike@panmedia.co.nz' , 'The author email should match expected value' ) ;
98- test . done ( ) ;
99- } ) ;
100- } ) ;
101- } ;
102-
103- exports . committerName = function ( test ) {
104- test . expect ( 1 ) ;
105- git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
106- repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
107- var committer = commit . committer ( ) ;
108- var name = committer . name ( ) ;
109- test . equals ( name , 'Michael Robinson' , 'The author name should match expected value' ) ;
110- test . done ( ) ;
111- } ) ;
112- } ) ;
113- } ;
67+ //exports.author = function(test) {
68+ // test.expect(2);
69+ // git.Repo.open('repos/workdir/.git', function(error, repository) {
70+ // repository.getCommit(historyCountKnownSHA, function(error, commit) {
71+ // var author = commit.author();
72+ // test.equals(error, null, 'There should be no error');
73+ // test.notEqual(author, null, 'Author should not be null');
74+ // test.done();
75+ // });
76+ // });
77+ //};
11478
115- exports . committerEmail = function ( test ) {
116- test . expect ( 1 ) ;
117- git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
118- repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
119- var committer = commit . committer ( ) ;
120- var email = committer . email ( ) ;
121- test . equals ( email , 'mike@panmedia.co.nz' , 'The committer email should match expected value' ) ;
122- test . done ( ) ;
123- } ) ;
124- } ) ;
125- } ;
79+ //exports.authorName = function(test) {
80+ // test.expect(1);
81+ // git.Repo.open('repos/workdir/.git', function(error, repository) {
82+ // repository.getCommit(historyCountKnownSHA, function(error, commit) {
83+ // var author = commit.author();
84+ // var name = author.name();
85+ // test.equals(name, 'Michael Robinson', 'The author name should match expected value');
86+ // test.done();
87+ // });
88+ // });
89+ //};
90+ //
91+ //exports.authorEmail = function(test) {
92+ // test.expect(1);
93+ // git.Repo.open('repos/workdir/.git', function(error, repository) {
94+ // repository.getCommit(historyCountKnownSHA, function(error, commit) {
95+ // var author = commit.author();
96+ // var email = author.email();
97+ // test.equals(email, 'mike@panmedia.co.nz', 'The author email should match expected value');
98+ // test.done();
99+ // });
100+ // });
101+ //};
102+ //
103+ //exports.committerName = function(test) {
104+ // test.expect(1);
105+ // git.Repo.open('repos/workdir/.git', function(error, repository) {
106+ // repository.getCommit(historyCountKnownSHA, function(error, commit) {
107+ // var committer = commit.committer();
108+ // var name = committer.name();
109+ // test.equals(name, 'Michael Robinson', 'The author name should match expected value');
110+ // test.done();
111+ // });
112+ // });
113+ //};
114+ //
115+ //exports.committerEmail = function(test) {
116+ // test.expect(1);
117+ // git.Repo.open('repos/workdir/.git', function(error, repository) {
118+ // repository.getCommit(historyCountKnownSHA, function(error, commit) {
119+ // var committer = commit.committer();
120+ // var email = committer.email();
121+ // test.equals(email, 'mike@panmedia.co.nz', 'The committer email should match expected value');
122+ // test.done();
123+ // });
124+ // });
125+ //};
126126
127127/**
128128 * Test that improper commit ID's result in an error message
@@ -183,43 +183,43 @@ exports.masterHead = function(test) {
183183 *
184184 * @param {Object } test
185185 */
186- // exports.parents = function(test) {
187- // test.expect(3);
188- // git.Repo.open('repos/workdir/.git', function(error, repository) {
189- // repository.getCommit(historyCountKnownSHA, function(error, commit) {
190- // commit.getParents(function(error, parents) {
191- // test.equals(parents.length, 1, 'Commit should have exactly one parent');
192- // var sha = parents[0].sha();
193- // test.equals(error, null, 'Getting parent SHA should not error');
194- // test.equals(sha, 'ecfd36c80a3e9081f200dfda2391acadb56dac27', 'Parent SHA should match expected value');
195- // test.done();
196- // });
197- // });
198- // });
199- // };
186+ exports . parents = function ( test ) {
187+ test . expect ( 3 ) ;
188+ git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
189+ repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
190+ commit . getParents ( function ( error , parents ) {
191+ test . equals ( parents . length , 1 , 'Commit should have exactly one parent' ) ;
192+ var sha = parents [ 0 ] . sha ( ) ;
193+ test . equals ( error , null , 'Getting parent SHA should not error' ) ;
194+ test . equals ( sha , 'ecfd36c80a3e9081f200dfda2391acadb56dac27' , 'Parent SHA should match expected value' ) ;
195+ test . done ( ) ;
196+ } ) ;
197+ } ) ;
198+ } ) ;
199+ } ;
200200
201201/**
202202 * Test that retrieving and walking a commit's tree works as expected.
203203 */
204- // exports.tree = function(test) {
205- // test.expect(2);
206- // git.Repo.open('repos/workdir/.git', function(error, repository) {
207- // repository.getCommit(historyCountKnownSHA, function(error, commit) {
208- // test.equals(error, null, 'Getting latest branch commit should not error');
209- //
210- // var commitTreeEntryCount = 0;
211- // var expectedCommitTreeEntryCount = 198;
212- // commit.getTree(function(error, tree) {
213- // tree.walk().on('entry', function(entry) {
214- // commitTreeEntryCount++;
215- // }).on('end', function(error, entries) {
216- // test.equals(commitTreeEntryCount, expectedCommitTreeEntryCount, 'Commit tree entry count does not match expected');
217- // test.done();
218- // }).start();
219- // });
220- // });
221- // });
222- // };
204+ exports . tree = function ( test ) {
205+ test . expect ( 2 ) ;
206+ git . Repo . open ( 'repos/workdir/.git' , function ( error , repository ) {
207+ repository . getCommit ( historyCountKnownSHA , function ( error , commit ) {
208+ test . equals ( error , null , 'Getting latest branch commit should not error' ) ;
209+
210+ var commitTreeEntryCount = 0 ;
211+ var expectedCommitTreeEntryCount = 198 ;
212+ commit . getTree ( function ( error , tree ) {
213+ tree . walk ( ) . on ( 'entry' , function ( entry ) {
214+ commitTreeEntryCount ++ ;
215+ } ) . on ( 'end' , function ( error , entries ) {
216+ test . equals ( commitTreeEntryCount , expectedCommitTreeEntryCount , 'Commit tree entry count does not match expected' ) ;
217+ test . done ( ) ;
218+ } ) . start ( ) ;
219+ } ) ;
220+ } ) ;
221+ } ) ;
222+ } ;
223223
224224/**
225225 * Test that getDiff works as expected.
0 commit comments