lib/sysrev/sysrev.js
function(systemId, env, cb) {
    var repoPath = _meta.repoPath(systemId);
    var tagName = baseTag + env;
    var editsTagName = editsTag + env;

    ngit.Repository.open(repoPath, function(err, repo) {
      if (err) { return cb(err); }

      ngit.Reference.nameToId(repo, tagName, function(err, head) {
        if (err && (!err.message || err.message.indexOf('not found') === -1)) { return cb(err); }
        if (head) {
          cb(null, head.toString());
        }
        else {
          ngit.Reference.nameToId(repo, editsTagName, function(err) {
            if (err) { return cb(err); }
            cb(null, EDITS);
          });
        }
      });
    });
  }
function(systemId, env, cb) {
    var repoPath = _meta.repoPath(systemId);
    var tagName = baseTag + env;
    var editsTagName = editsTag + env;

    ngit.Repository.open(repoPath, function(err, repo) {
      if (err) { return cb(err); }

      ngit.Reference.nameToId(repo, tagName, function(err, head) {
        if (err && (!err.message || err.message.indexOf('not found') === -1)) { return cb(err); }
        if (head) {
          cb(null, head.toString());
        }
        else {
          ngit.Reference.nameToId(repo, editsTagName, function(err) {
            if (err) { return cb(err); }
            cb(null, EDITS);
          });
        }
      });
    });
  }
get the currently deployed revision