next-issue 6.6.109 → 6.6.111

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/dist/git-merge.mjs +10 -4
  2. package/package.json +1 -1
@@ -1,17 +1,15 @@
1
1
  import { join } from 'node:path';
2
- import { run, succeeded } from './exec.mjs';
2
+ import { failedWith, run, succeeded } from './exec.mjs';
3
3
  import { readTextOrEmpty } from './files.mjs';
4
4
  import { commitEverything } from './git-commit.mjs';
5
5
  import { fetchBase, git, isAncestor, resetHard, succeeds } from './git.mjs';
6
- import { lines } from './text.mjs';
7
6
  export async function startMerge(cwd, base, remote) {
8
7
  const target = await git(cwd, ['rev-parse', await fetchBase(cwd, base, remote)]);
9
8
  const result = await run('git', ['merge', '--no-ff', '--no-commit', target], { cwd });
10
9
  if (succeeded(result)) {
11
10
  return { target, files: (await merging(cwd)) ? [] : undefined, unmarked: [] };
12
11
  }
13
- const listed = await git(cwd, ['diff', '--name-only', '--diff-filter=U']);
14
- const files = lines(listed);
12
+ const files = await unmergedFiles(cwd);
15
13
  if (files.length === 0) {
16
14
  throw new Error(`git merge ${target} failed: ${result.stderr.trim()}`);
17
15
  }
@@ -23,6 +21,14 @@ export async function startMerge(cwd, base, remote) {
23
21
  }
24
22
  return { target, files, unmarked };
25
23
  }
24
+ async function unmergedFiles(cwd) {
25
+ const args = ['diff', '--name-only', '-z', '--diff-filter=U'];
26
+ const listed = await run('git', args, { cwd });
27
+ if (!succeeded(listed)) {
28
+ throw new Error(failedWith(`git ${args.join(' ')}`, listed));
29
+ }
30
+ return listed.stdout.split('\0').filter((file) => file !== '');
31
+ }
26
32
  async function merging(cwd) {
27
33
  return succeeds(cwd, ['rev-parse', '--quiet', '--verify', 'MERGE_HEAD']);
28
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.109",
3
+ "version": "6.6.111",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",