diff --git a/lib/manager/composer/lock-file.js b/lib/manager/composer/lock-file.js index d736d75e664285bafdd137a7330cbbafa301627e..30c353e225e40395c7affe1740c8bd8bbd98a8d5 100644 --- a/lib/manager/composer/lock-file.js +++ b/lib/manager/composer/lock-file.js @@ -33,7 +33,9 @@ async function getLockFile( JSON.stringify(newPackageFileParsed) ); const localLockFileName = upath.join(config.localDir, lockFileName); - await fs.outputFile(localLockFileName, existingLockFileContent); + if (!config.gitFs) { + await fs.outputFile(localLockFileName, existingLockFileContent); + } const credentials = endpoints.find({ platform: 'github', host: 'api.github.com', @@ -63,19 +65,28 @@ async function getLockFile( logger.debug(`composer stderr:\n${stderr}`); const duration = process.hrtime(startTime); const seconds = Math.round(duration[0] + duration[1] / 1e9); - const newLockFileContent = await fs.readFile(localLockFileName, 'utf8'); logger.info( { seconds, type: 'composer.lock', stdout, stderr }, 'Generated lockfile' ); - if (newLockFileContent === existingLockFileContent) { - logger.debug('composer.lock is unchanged'); - return null; + // istanbul ignore if + if (config.gitFs) { + const status = await platform.getRepoStatus(); + if (!status.modified.includes(lockFileName)) { + return null; + } + } else { + const newLockFileContent = await fs.readFile(localLockFileName, 'utf8'); + + if (newLockFileContent === existingLockFileContent) { + logger.debug('composer.lock is unchanged'); + return null; + } } logger.debug('Returning updated composer.lock'); return { name: lockFileName, - contents: newLockFileContent, + contents: await fs.readFile(localLockFileName, 'utf8'), }; } catch (err) { logger.warn(