Skip to content
Browse files

Added Project.getLastCommitHash

  • Loading branch information...
1 parent 7e24021 commit ef6eafbc79210cf41a12d865da0ac2450ddcc389 @gseguin committed Oct 2, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/project.js
View
12 lib/project.js
@@ -31,6 +31,11 @@ function remoteUpdate( repoDir, callback ) {
Git.exec( [ "remote", "update" ], callback );
}
+function getLastCommitHash( repoDir, callback ) {
+ Git( repoDir );
+ Git.exec( [ "log", "-1", "--pretty=format:%H" ], callback );
+}
+
function cleanup( project, callback ) {
var compiled = project.getCompiledDirSync();
@@ -228,4 +233,11 @@ Project.prototype.remoteUpdate = function( callback ) {
}
+Project.prototype.getLastCommitHash = function( callback ) {
+ async.waterfall([
+ _.bind( this.getRepoDir, this ),
+ getLastCommitHash
+ ], callback );
+}
+
module.exports.fetch = fetch;

0 comments on commit ef6eafb

Please sign in to comment.
Something went wrong with that request. Please try again.