mirror of
https://github.com/danog/gift.git
synced 2024-12-02 09:17:55 +01:00
abd70f5111
Includes: - Repo.commit: send stdout/stderr to callback lile other methods - Repo.commit: possibility to specify author - git.refs: ignore error code 1 which means that no refs are available. - git: use binary encoding for child_process.exec() to allow binary files content retrieval from history.
36 lines
963 B
CoffeeScript
36 lines
963 B
CoffeeScript
should = require 'should'
|
|
fixtures = require './fixtures'
|
|
git = require '../src'
|
|
Commit = require '../src/commit'
|
|
Tree = require '../src/tree'
|
|
|
|
describe "Commit", ->
|
|
describe "#tree", ->
|
|
repo = git "#{__dirname}/fixtures/branched"
|
|
tree = null
|
|
before (done) ->
|
|
repo.commits "master", (err, commits) ->
|
|
tree = commits[0].tree()
|
|
done err
|
|
|
|
it "passes a tree", ->
|
|
tree.should.be.an.instanceof Tree
|
|
|
|
|
|
describe "#parents", ->
|
|
repo = fixtures.branched
|
|
parents = null
|
|
parent = null
|
|
before (done) ->
|
|
repo.commits "something", (err, commits) ->
|
|
parents = commits[0].parents()
|
|
parent = commits[1]
|
|
done err
|
|
|
|
it "is an Array of Commits", ->
|
|
parents.should.be.an.instanceof Array
|
|
parents[0].should.be.an.instanceof Commit
|
|
|
|
it "has the parent commit", ->
|
|
parents[0].id.should.eql parent.id
|