next-issue 6.6.0 → 6.6.1
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/dist/git-land.mjs +2 -2
- package/dist/git.mjs +9 -2
- package/dist/hunt.mjs +2 -2
- package/dist/worktree.mjs +3 -3
- package/package.json +1 -1
package/dist/git-land.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchBase, git, remoteRef, revision, succeeds } from './git.mjs';
|
|
1
|
+
import { fetchBase, git, oneFetchAtATime, remoteRef, revision, succeeds } from './git.mjs';
|
|
2
2
|
import { commitEverything } from './git-commit.mjs';
|
|
3
3
|
export const PUSH_TRIES = 3;
|
|
4
4
|
export async function squashOnto(cwd, base, remote, message) {
|
|
@@ -18,7 +18,7 @@ export async function squashOnto(cwd, base, remote, message) {
|
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
20
|
export async function pushToBase(cwd, remote, base) {
|
|
21
|
-
return succeeds(cwd, ['push', remote, `HEAD:refs/heads/${base}`]);
|
|
21
|
+
return oneFetchAtATime(() => succeeds(cwd, ['push', remote, `HEAD:refs/heads/${base}`]));
|
|
22
22
|
}
|
|
23
23
|
export async function revertOnBase(cwd, revert) {
|
|
24
24
|
const { branch } = revert;
|
package/dist/git.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { must, optionalFlag, run, succeeded } from './exec.mjs';
|
|
2
|
+
import { oneAtATime } from './lock.mjs';
|
|
2
3
|
import { lines } from './text.mjs';
|
|
3
4
|
const REMOTE_PATTERNS = [
|
|
4
5
|
/^git@[^:]+:(?<owner>[^/]+)\/(?<name>[^/]+?)(?:\.git)?$/,
|
|
@@ -64,12 +65,18 @@ export async function disputeBranches(repo, branch) {
|
|
|
64
65
|
return lines(list);
|
|
65
66
|
}
|
|
66
67
|
export async function push(cwd, remote, branch, force = false) {
|
|
67
|
-
await git(cwd, ['push', '-u', ...optionalFlag(force, '--force'), remote, branch]);
|
|
68
|
+
await oneFetchAtATime(() => git(cwd, ['push', '-u', ...optionalFlag(force, '--force'), remote, branch]));
|
|
68
69
|
}
|
|
69
70
|
export async function fetchBase(cwd, base, remote) {
|
|
70
|
-
await
|
|
71
|
+
await gitFetch(cwd, [remote, base]);
|
|
71
72
|
return remoteRef(remote, base);
|
|
72
73
|
}
|
|
74
|
+
export function oneFetchAtATime(work) {
|
|
75
|
+
return oneAtATime('git fetch', work);
|
|
76
|
+
}
|
|
77
|
+
export function gitFetch(cwd, args) {
|
|
78
|
+
return oneFetchAtATime(() => git(cwd, ['fetch', ...args]));
|
|
79
|
+
}
|
|
73
80
|
export async function resetToBase(cwd, base, remote) {
|
|
74
81
|
const target = await fetchBase(cwd, base, remote);
|
|
75
82
|
await git(cwd, ['reset', '--hard', target]);
|
package/dist/hunt.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { setTimeout as delay } from 'node:timers/promises';
|
|
|
4
4
|
import { REVIEWING } from './agents.mjs';
|
|
5
5
|
import { minutesToMs } from './durations.mjs';
|
|
6
6
|
import { readTextIfPresent } from './files.mjs';
|
|
7
|
-
import { git, remoteRef, resetHard } from './git.mjs';
|
|
7
|
+
import { git, gitFetch, remoteRef, resetHard } from './git.mjs';
|
|
8
8
|
import { oneAtATime } from './lock.mjs';
|
|
9
9
|
import { huntPrompt } from './prompts.mjs';
|
|
10
10
|
import { skipReason } from './skip.mjs';
|
|
@@ -14,7 +14,7 @@ const FILED = /^issue:\s*(\S+)\s*$/gm;
|
|
|
14
14
|
export async function huntWorktree(repo, base, remote) {
|
|
15
15
|
const path = join(repo.root, WORKTREE_DIR, 'hunt');
|
|
16
16
|
const target = remoteRef(remote, base);
|
|
17
|
-
await
|
|
17
|
+
await gitFetch(repo.root, [remote]);
|
|
18
18
|
await git(repo.root, ['worktree', 'prune']);
|
|
19
19
|
if (existsSync(join(path, '.git'))) {
|
|
20
20
|
await resetHard(path, target);
|
package/dist/worktree.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import { currentBranch, discardChanges, git, isAncestor, remoteRef, succeeds, } from './git.mjs';
|
|
2
|
+
import { currentBranch, discardChanges, git, gitFetch, isAncestor, oneFetchAtATime, remoteRef, succeeds, } from './git.mjs';
|
|
3
3
|
export const WORKTREE_DIR = '.worktrees';
|
|
4
4
|
function worktreePath(repo, issue) {
|
|
5
5
|
return join(repo.root, WORKTREE_DIR, String(issue));
|
|
@@ -39,7 +39,7 @@ async function hasBranch(repo, name, ...flags) {
|
|
|
39
39
|
return list.length > 0;
|
|
40
40
|
}
|
|
41
41
|
export async function fastForwardBase(repo, base, remote) {
|
|
42
|
-
await
|
|
42
|
+
await gitFetch(repo.root, [remote]);
|
|
43
43
|
return updateBase(repo, base, remote);
|
|
44
44
|
}
|
|
45
45
|
async function updateBase(repo, base, remote) {
|
|
@@ -47,7 +47,7 @@ async function updateBase(repo, base, remote) {
|
|
|
47
47
|
const args = (await currentBranch(repo.root)) === base
|
|
48
48
|
? ['merge', '--ff-only', remoteBase]
|
|
49
49
|
: ['fetch', '.', `${remoteBase}:${base}`];
|
|
50
|
-
return succeeds(repo.root, args);
|
|
50
|
+
return oneFetchAtATime(() => succeeds(repo.root, args));
|
|
51
51
|
}
|
|
52
52
|
export async function findWorktree(repo, branch) {
|
|
53
53
|
const list = await git(repo.root, ['worktree', 'list', '--porcelain']);
|