Bug fixes on the git fs resolver.

This commit is contained in:
André Cruz
2013-04-14 17:46:18 +01:00
parent 4bbafe13e6
commit f2667bfcae

View File

@@ -43,14 +43,14 @@ GitFsResolver.prototype._copy = function () {
// Copy folder contents
.then(function () {
return Q.nfcall(ncp, this._source, tempDir);
});
}.bind(this));
};
GitFsResolver.prototype._fetch = function () {
var dir = this._tempDir;
// Check if there is at least one remote
cmd('git', ['remote'], { cwd: dir })
return cmd('git', ['remote'], { cwd: dir })
.then(function (stdout) {
var hasRemote = !!stdout.trim().length;
@@ -68,7 +68,7 @@ GitFsResolver.prototype._checkout = function (resolution) {
console.log(resolution);
// Checkout resolution
cmd('git', ['checkout', '-f', resolution.tag || resolution.branch || resolution.commit], { cwd: dir })
return cmd('git', ['checkout', '-f', resolution.tag || resolution.branch || resolution.commit], { cwd: dir })
// Cleanup unstagged files
.then(function () {
return cmd('git', ['clean', '-f', '-d'], { cwd: dir });