fix(gitFs): set explicit remote branch (#3229)

This pr fixes the windows specific git bug by setting the remove branch name explicitly when pushing.

Closes #3204
This commit is contained in:
Michael Kriese 2019-02-18 12:52:10 +01:00 committed by Rhys Arkins
parent 20a53ba7be
commit bb15977e39

View file

@ -271,7 +271,12 @@ class Storage {
} }
await git.add(files.map(f => f.name)); await git.add(files.map(f => f.name));
await git.commit(message); await git.commit(message);
await git.push(['origin', branchName, '--force']); await git.push([
'origin',
`${branchName}:${branchName}`,
'--force',
'-u',
]);
} 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('[remote rejected]')) { if (err.message.includes('[remote rejected]')) {