@mrpatronz/nexusflow 0.2.6 → 0.2.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAOf"}
1
+ {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAwEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -25,22 +25,30 @@ export async function createWorktree(repoPath, targetPath, branchName, baseBranc
25
25
  catch {
26
26
  // Silently ignore fetch failures (e.g., offline or no remote origin)
27
27
  }
28
- // Update local baseBranch to keep it in sync with remote before branching
28
+ // Update local base branch, main, and master to keep them in sync with remote before branching
29
29
  if (fetched) {
30
30
  try {
31
- // Find out if the main repo currently has baseBranch checked out
32
- const { stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { cwd: repoPath });
33
- if (currentBranch.trim() === baseBranch) {
34
- // Safe fast-forward pull
35
- await execa('git', ['pull', '--ff-only'], { cwd: repoPath });
36
- }
37
- else {
38
- // Fast-forward local ref from remote ref without checkout
39
- await execa('git', ['fetch', 'origin', `${baseBranch}:${baseBranch}`], { cwd: repoPath });
31
+ const { stdout: currentBranchRaw } = await execa('git', ['branch', '--show-current'], { cwd: repoPath });
32
+ const currentBranch = currentBranchRaw.trim();
33
+ const branchesToUpdate = Array.from(new Set([baseBranch, 'main', 'master']));
34
+ for (const branch of branchesToUpdate) {
35
+ try {
36
+ if (currentBranch === branch) {
37
+ // Safe fast-forward pull for the currently checked-out branch
38
+ await execa('git', ['pull', '--ff-only'], { cwd: repoPath });
39
+ }
40
+ else {
41
+ // Fast-forward local ref from remote ref without checkout
42
+ await execa('git', ['fetch', 'origin', `${branch}:${branch}`], { cwd: repoPath });
43
+ }
44
+ }
45
+ catch {
46
+ // Ignore individual branch update failures
47
+ }
40
48
  }
41
49
  }
42
50
  catch {
43
- // Ignore failures (e.g. non-fast-forward, uncommitted changes, or no upstream tracking branch)
51
+ // Ignore failures
44
52
  }
45
53
  }
46
54
  // Determine starting point: remote branch if fetched successfully and exists, else local branch.
@@ -1 +1 @@
1
- {"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,UAAkB,EAClB,UAAkB,EAClB,UAAkB;IAElB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,6BAA6B;IAC7B,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,OAAO,GAAG,IAAI,CAAC;I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,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACpC,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxB,MAAM,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrpatronz/nexusflow",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Combine multiple repos into a workspace with rich AI assistant context",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,20 +32,29 @@ export async function createWorktree(
32
32
  // Silently ignore fetch failures (e.g., offline or no remote origin)
33
33
  }
34
34
 
35
- // Update local baseBranch to keep it in sync with remote before branching
35
+ // Update local base branch, main, and master to keep them in sync with remote before branching
36
36
  if (fetched) {
37
37
  try {
38
- // Find out if the main repo currently has baseBranch checked out
39
- const { stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { cwd: repoPath });
40
- if (currentBranch.trim() === baseBranch) {
41
- // Safe fast-forward pull
42
- await execa('git', ['pull', '--ff-only'], { cwd: repoPath });
43
- } else {
44
- // Fast-forward local ref from remote ref without checkout
45
- await execa('git', ['fetch', 'origin', `${baseBranch}:${baseBranch}`], { cwd: repoPath });
38
+ const { stdout: currentBranchRaw } = await execa('git', ['branch', '--show-current'], { cwd: repoPath });
39
+ const currentBranch = currentBranchRaw.trim();
40
+
41
+ const branchesToUpdate = Array.from(new Set([baseBranch, 'main', 'master']));
42
+
43
+ for (const branch of branchesToUpdate) {
44
+ try {
45
+ if (currentBranch === branch) {
46
+ // Safe fast-forward pull for the currently checked-out branch
47
+ await execa('git', ['pull', '--ff-only'], { cwd: repoPath });
48
+ } else {
49
+ // Fast-forward local ref from remote ref without checkout
50
+ await execa('git', ['fetch', 'origin', `${branch}:${branch}`], { cwd: repoPath });
51
+ }
52
+ } catch {
53
+ // Ignore individual branch update failures
54
+ }
46
55
  }
47
56
  } catch {
48
- // Ignore failures (e.g. non-fast-forward, uncommitted changes, or no upstream tracking branch)
57
+ // Ignore failures
49
58
  }
50
59
  }
51
60