Skip to content
Browse files

Fixed broken test

  • Loading branch information...
1 parent 464e4bd commit a2637d86c8bda7f70e36655a252ac7d04eefb4c9 @ciaranj ciaranj committed Dec 30, 2010
Showing with 13 additions and 9 deletions.
  1. +13 −9 lib/git/git_file_operations.js
View
22 lib/git/git_file_operations.js
@@ -54,15 +54,19 @@ GitFileOperations.glob_streaming = function(path) {
// Fetch the top directory
fs.readdir(path, function(err, entries) {
// The top level of files that need to be finished processing for us to be done
- top_level_files_count = entries.length;
- // Execute the entries
- for(var i = 0; i < entries.length; i++) {
- // Entry path
- var entry_path = path + "/" + entries[i];
- // Build glob function
- stat_with_entry(entry_path, stream, function() {
- processed_directories_count = processed_directories_count + 1;
- })();
+ if( entries !== undefined && entries.length > 0 ) {
+ top_level_files_count = entries.length;
+ // Execute the entries
+ for(var i = 0; i < entries.length; i++) {
+ // Entry path
+ var entry_path = path + "/" + entries[i];
+ // Build glob function
+ stat_with_entry(entry_path, stream, function() {
+ processed_directories_count = processed_directories_count + 1;
+ })();
+ }
+ } else {
+ top_level_files_count= 0;
}
});
// Return the stream for execution

0 comments on commit a2637d8

Please sign in to comment.
Something went wrong with that request. Please try again.