1
0
mirror of https://github.com/danog/gift.git synced 2024-11-26 20:04:47 +01:00

compiled everything in ./src to ./lib using CoffeeScript 1.6.1 [again x4]

This commit is contained in:
Luke Plaster 2013-03-14 23:31:21 +00:00
parent 38ec5ad33b
commit ef4b7cf68c

View File

@ -1,10 +1,12 @@
(function() {
var Commit, Diff, Head, Ref, Repo, Status, Tag, Tree, cmd, _, _ref;
var Actor, Commit, Diff, Head, Ref, Repo, Status, Tag, Tree, cmd, _, _ref;
_ = require('underscore');
cmd = require('./git');
Actor = require('./actor');
Commit = require('./commit');
Tree = require('./tree');
@ -30,6 +32,46 @@
this.git = cmd(this.path, this.dot_git);
}
Repo.prototype.identity = function(callback) {
var _this = this;
return this.git("config", {}, ["user.email"], function(err, stdout) {
var email;
if (stdout == null) {
stdout = '';
}
if (err) {
return callback(err);
}
email = stdout != null ? stdout.trim() : void 0;
return _this.git("config", {}, ["user.name"], function(err, stdout) {
var name;
if (stdout == null) {
stdout = '';
}
if (err) {
return callback(err);
}
name = stdout != null ? stdout.trim() : void 0;
return callback(null, new Actor(name, email));
});
});
};
Repo.prototype.identify = function(actor, callback) {
var _this = this;
return this.git("config", {}, ["user.email", "\"" + actor.email + "\""], function(err) {
if (err) {
return callback(err);
}
return _this.git("config", {}, ["user.name", "\"" + actor.name + "\""], function(err) {
if (err) {
return callback(err);
}
return callback(null);
});
});
};
Repo.prototype.commits = function(start, limit, skip, callback) {
var _ref1, _ref2, _ref3;
if (!callback) {