fix(git): git pull immediately after automerge (#10390)

Call git.pull() before performing a fetch, to handle the case where the default branch has been updated.

Closes #10372
This commit is contained in:
Rhys Arkins 2021-06-10 22:12:45 +02:00 committed by GitHub
parent 0e0f08b599
commit e1c7845dee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,6 +266,7 @@ export async function syncGit(): Promise<void> {
try { try {
await git.raw(['remote', 'set-url', 'origin', config.url]); await git.raw(['remote', 'set-url', 'origin', config.url]);
await resetToBranch(await getDefaultBranch(git)); await resetToBranch(await getDefaultBranch(git));
await git.pull();
// istanbul ignore if // istanbul ignore if
if (process.env.NODE_ENV !== 'test') { if (process.env.NODE_ENV !== 'test') {
await git.raw(['config', '--unset-all', 'remote.origin.fetch']); await git.raw(['config', '--unset-all', 'remote.origin.fetch']);