@rathnasgala/cli 1.1.11 → 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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/git.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rathnasgala/cli",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -26,7 +26,7 @@
26
26
  "url": "git+https://github.com/rathnasgala/cli.git"
27
27
  },
28
28
  "dependencies": {
29
- "@rathnasgala/content-validation": "0.0.28",
29
+ "@rathnasgala/content-validation": "0.0.29",
30
30
  "libsodium-wrappers": "0.8.4",
31
31
  "tar": "7.5.22",
32
32
  "yaml": "2.9.0"
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}`]);