@rathnasgala/cli 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/git.js +8 -0
package/package.json
CHANGED
package/src/git.js
CHANGED
|
@@ -105,6 +105,14 @@ export function createGit({ root, token, spawnProcess = spawn } = {}) {
|
|
|
105
105
|
* makes the post-publish validation pass the sole local writer of any missing content ID.
|
|
106
106
|
*/
|
|
107
107
|
async takeRemote() {
|
|
108
|
+
const unmerged = await run(['diff', '--name-only', '--diff-filter=U', '-z'], { capture: true });
|
|
109
|
+
const conflictedPaths = unmerged.split('\0').filter(Boolean);
|
|
110
|
+
if (conflictedPaths.length > 0) {
|
|
111
|
+
const failure = new Error('Git has unresolved conflicts. Gala left them untouched. Run git '
|
|
112
|
+
+ 'status, resolve or abort the operation it reports, then publish again.');
|
|
113
|
+
failure.detail = `Conflicted files:\n${conflictedPaths.join('\n')}`;
|
|
114
|
+
throw failure;
|
|
115
|
+
}
|
|
108
116
|
const branch = await git.branch();
|
|
109
117
|
await run(['fetch', 'origin', branch]);
|
|
110
118
|
await run(['rebase', '--autostash', `origin/${branch}`]);
|