docs: function branchFromJob(job) {
    var ref = job.ref;
  
    if (typeof ref === 'undefined') {
      return '';
    }
  
    if ('branch' in ref) {
      return ref.branch;
    } else if ('fetch' in ref) {
      return ref.fetch;
    } else {
      // This is going to be incredibly ugly, but it will be (a) consistent for consistent refs and
      // (b) include only filesystem-safe characters.
      return encodeURIComponent(stringify(ref));
    }
  }