Add some tests to the GitFsResolver.

This commit is contained in:
André Cruz
2013-04-23 23:38:13 +01:00
parent a87969d85f
commit f46ec05a3a
5 changed files with 135 additions and 22 deletions

15
test/util/fetchBranch.js Normal file
View File

@@ -0,0 +1,15 @@
var cmd = require('../../lib/util/cmd');
function fetchBranch(branch, dir) {
return cmd('git', ['checkout', '-b', branch, 'origin/' + branch], { cwd: dir })
.then(null, function (err) {
if (/already exists/i.test(err.details)) {
return cmd('git', ['checkout', branch], { cwd: dir })
.then(function () {
return cmd('git', ['pull', 'origin', branch], { cwd: dir });
});
}
});
}
module.exports = fetchBranch;