Merge branch 'rewrite' of github.com:twitter/bower into rewrite

This commit is contained in:
marcooliveira
2013-04-24 03:05:24 +01:00
9 changed files with 60 additions and 48 deletions

View File

@@ -151,7 +151,7 @@ Resolver.prototype._applyPkgMeta = function (meta) {
var filter = this._createIgnoreFilter(meta.ignore),
promises = [];
// Foreach file that passes the ignore filter,
// For each file that passes the ignore filter,
// rimraf it
files.forEach(function (file) {
if (filter(file)) {

View File

@@ -78,7 +78,7 @@ Worker.prototype._processEntry = function (entry) {
// If there is a free slot for every tag
if (allFree) {
// Foreach type
// For each type
entry.types.forEach(function (type) {
// Remove entry from the queue
mout.array.remove(this._queue[type], entry);
@@ -104,7 +104,7 @@ Worker.prototype._processEntry = function (entry) {
Worker.prototype._onResolve = function (entry, ok, result) {
// Resolve/reject the deferred based on sucess/error of the promise
// Resolve/reject the deferred based on success/error of the promise
if (ok) {
entry.deferred.resolve(result);
} else {

View File

@@ -9,8 +9,6 @@ var path = require('path');
var GitFsResolver = function (source, options) {
// Ensure absolute path
// TODO: should sources that arrive here be already absolute
// or is ok to do this here?
source = path.resolve(source);
GitResolver.call(this, source, options);
@@ -52,8 +50,6 @@ GitFsResolver.prototype._copy = function (meta) {
GitFsResolver.prototype._checkout = function () {
var resolution = this._resolution;
console.log(resolution);
// Checkout resolution
return cmd('git', ['checkout', '-f', resolution.tag || resolution.branch || resolution.commit], { cwd: this._tempDir })
// Cleanup unstagged files

View File

@@ -17,10 +17,8 @@ GitRemoteResolver.prototype._checkout = function () {
var branch,
resolution = this._resolution;
console.log(resolution);
// If resolution is a commit, we need to clone the entire repo and checkit out
// Because a commit is not a nammed ref, there's no better solution
// If resolution is a commit, we need to clone the entire repo and check it out
// Because a commit is not a named ref, there's no better solution
if (resolution.type === 'commit') {
return cmd('git', ['clone', this._source, this._tempDir])
.then(cmd.bind(cmd, 'git', ['checkout', resolution.commit], { cwd: this._tempDir }));

View File

@@ -166,7 +166,7 @@ GitResolver.fetchVersions = function (source) {
.then(function (refs) {
var versions = [];
// Foreach line in the refs, match only the tags
// For each line in the refs, match only the tags
refs.forEach(function (line) {
var match = line.match(/^([a-f0-9]{40})\s+refs\/tags\/(\S+)/),
tag,
@@ -202,7 +202,7 @@ GitResolver.fetchHeads = function (source) {
this._heads = this._heads || {};
var heads = this._heads[source] = this._heads[source] || {};
// Foreach line in the refs, extract only the heads
// For each line in the refs, extract only the heads
// Organize them in an object where keys are branches and values
// the commit hashes
refs.forEach(function (line) {