lib/platform/azure/azure-helper.js
async function getFile(repoId, repository, filePath, branchName) {
  logger.trace(`getFile(filePath=${filePath}, branchName=${branchName})`);
  const azureApiGit = await azureApi.gitApi();
  const item = await azureApiGit.getItemText(
    repoId,
    filePath,
    null,
    null,
    0, // because we look for 1 file
    false,
    false,
    true,
    {
      versionType: 0, // branch
      versionOptions: 0,
      version: getBranchNameWithoutRefsheadsPrefix(branchName),
    }
  );

  if (item && item.readable) {
    const fileContent = await streamToString(item);
    try {
      const jTmp = JSON.parse(fileContent);
      if (jTmp.typeKey === 'GitItemNotFoundException') {
        // file not found
        return null;
      }
      if (jTmp.typeKey === 'GitUnresolvableToCommitException') {
        // branch not found
        return null;
      }
    } catch (error) {
      // it 's not a JSON, so I send the content directly with the line under
    }
    return fileContent;
  }
  return null; // no file found
}
async function getFile(repoId, repository, filePath, branchName) {
  logger.trace(`getFile(filePath=${filePath}, branchName=${branchName})`);
  const azureApiGit = await azureApi.gitApi();
  const item = await azureApiGit.getItemText(
    repoId,
    filePath,
    null,
    null,
    0, // because we look for 1 file
    false,
    false,
    true,
    {
      versionType: 0, // branch
      versionOptions: 0,
      version: getBranchNameWithoutRefsheadsPrefix(branchName),
    }
  );

  if (item && item.readable) {
    const fileContent = await streamToString(item);
    try {
      const jTmp = JSON.parse(fileContent);
      if (jTmp.typeKey === 'GitItemNotFoundException') {
        // file not found
        return null;
      }
      if (jTmp.typeKey === 'GitUnresolvableToCommitException') {
        // branch not found
        return null;
      }
    } catch (error) {
      // it 's not a JSON, so I send the content directly with the line under
    }
    return fileContent;
  }
  return null; // no file found
}
async function getFile ( repoId , repository , filePath , branchName ) { logger . trace ( ` ${ filePath } ${ branchName } ` ) ; const azureApiGit = await azureApi . gitApi ( ) ; const item = await azureApiGit . getItemText ( repoId , filePath , null , null , 0 , // because we look for 1 file false , false , true , { versionType : 0 , // branch versionOptions : 0 , version : getBranchNameWithoutRefsheadsPrefix ( branchName ) , } ) ; if ( item && item . readable ) { const fileContent = await streamToString ( item ) ; try { const jTmp = JSON . parse ( fileContent ) ; if ( jTmp . typeKey === 'GitItemNotFoundException' ) { // file not found return null ; } if ( jTmp . typeKey === 'GitUnresolvableToCommitException' ) { // branch not found return null ; } } catch ( error ) { // it 's not a JSON, so I send the content directly with the line under } return fileContent ; } return null ; // no file found }
if no branchName, look globaly
@param {string} repoId
@param {string} repository
@param {string} filePath
@param {string} branchName
if no branchName look globaly