(repo, id, name, variable)
| 61 | } |
| 62 | |
| 63 | var lazy_reader = function(repo, id, name, variable) { |
| 64 | if(variable != null) return variable; |
| 65 | // Control the flow |
| 66 | var done = false; |
| 67 | var value = null; |
| 68 | // Fetch all the commits |
| 69 | Commit.find_all(repo, id, {max_count:1}, function(err, commits) { |
| 70 | if(err) return done = true; |
| 71 | value = commits[0][name]; |
| 72 | done = true; |
| 73 | }) |
| 74 | |
| 75 | while(!done) {}; |
| 76 | return value ? value : ''; |
| 77 | } |
| 78 | |
| 79 | // Load a commit |
| 80 | Commit.prototype.load = function(callback) { |