mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Add some tests to the GitFsResolver.
This commit is contained in:
15
test/util/fetchBranch.js
Normal file
15
test/util/fetchBranch.js
Normal 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;
|
||||
Reference in New Issue
Block a user