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, '--force': true,
'-u': true, '-u': true,
}); });
try { // Fetch it after create
await this._git!.raw([ const ref = `refs/heads/${branchName}:refs/remotes/origin/${branchName}`;
'remote', await this._git!.fetch(['origin', ref, '--depth=2', '--force']);
'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');
}
} catch (err) /* istanbul ignore next */ { } catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Error commiting files'); logger.debug({ err }, 'Error commiting files');
if (err.message.includes('.github/main.workflow')) { if (err.message.includes('.github/main.workflow')) {