More succinct.

This commit is contained in:
André Cruz
2013-04-14 18:11:47 +01:00
parent 543407920d
commit c117ef3000
2 changed files with 2 additions and 6 deletions

View File

@@ -69,9 +69,7 @@ GitFsResolver.prototype._checkout = function (resolution) {
// Checkout resolution
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 });
});
.then(cmd.bind(cmd, 'git', ['clean', '-f', '-d'], { cwd: dir }));
};
// -----------------

View File

@@ -23,9 +23,7 @@ GitRemoteResolver.prototype._checkout = function (resolution) {
// Because a commit is not a nammed ref, there's no better solution
if (resolution.type === 'commit') {
return cmd('git', ['clone', this._source, '.'], { cwd: dir })
.then(function () {
return cmd('git', ['checkout', resolution.commit], { cwd: dir });
});
.then(cmd.bind(cmd, 'git', ['checkout', resolution.commit], { cwd: dir }));
// Otherwise we are checking out a named ref so we can optimize it
} else {
branch = resolution.tag || resolution.branch;