MCPcopy Index your code
hub / github.com/christkv/node-git / lazy_reader

Function lazy_reader

lib/git/commit.js:63–77  ·  view source on GitHub ↗
(repo, id, name, variable)

Source from the content-addressed store, hash-verified

61}
62
63var 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
80Commit.prototype.load = function(callback) {

Callers 1

commit.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected