fix(gitFs): post-commit fetch

This commit is contained in:
Rhys Arkins 2019-05-17 16:56:08 +02:00
parent b701e15870
commit c59233819b

View file

@ -403,18 +403,9 @@ class Storage {
'--force': true,
'-u': true,
});
try {
await this._git!.raw([
'remote',
'set-branches',
'--add',
'origin',
branchName,
]);
await this._git!.fetch(['origin', branchName, '--depth=2']);
} catch (err) /* istanbul ignore next */ {
logger.info({ err }, 'Error fetching branch after create');
}
// Fetch it after create
const ref = `refs/heads/${branchName}:refs/remotes/origin/${branchName}`;
await this._git!.fetch(['origin', ref, '--depth=2', '--force']);
} catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Error commiting files');
if (err.message.includes('.github/main.workflow')) {