@pcoliveira90/pdd 0.5.0 → 0.5.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/package.json
CHANGED
|
@@ -52,6 +52,8 @@ export function createLinkedWorktree({
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const topLevel = context.topLevel;
|
|
55
|
+
const currentBranch = runGit(['rev-parse', '--abbrev-ref', 'HEAD'], baseDir);
|
|
56
|
+
const startPoint = currentBranch && currentBranch !== 'HEAD' ? currentBranch : 'HEAD';
|
|
55
57
|
const repoName = slug(path.basename(topLevel), 24);
|
|
56
58
|
const commandSlug = slug(commandName, 24);
|
|
57
59
|
const stamp = Date.now();
|
|
@@ -63,13 +65,14 @@ export function createLinkedWorktree({
|
|
|
63
65
|
|
|
64
66
|
execFileSync(
|
|
65
67
|
'git',
|
|
66
|
-
['worktree', 'add', '-b', branchName, worktreePath,
|
|
68
|
+
['worktree', 'add', '-b', branchName, worktreePath, startPoint],
|
|
67
69
|
{ cwd: topLevel, stdio: 'pipe' }
|
|
68
70
|
);
|
|
69
71
|
|
|
70
72
|
return {
|
|
71
73
|
worktreePath,
|
|
72
|
-
branchName
|
|
74
|
+
branchName,
|
|
75
|
+
baseBranch: startPoint
|
|
73
76
|
};
|
|
74
77
|
}
|
|
75
78
|
|
|
@@ -105,12 +108,13 @@ export function maybeAutoRelocateToWorktree({ cwd, argv, commandName }) {
|
|
|
105
108
|
return false;
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
const { worktreePath, branchName } = createLinkedWorktree({
|
|
111
|
+
const { worktreePath, branchName, baseBranch } = createLinkedWorktree({
|
|
109
112
|
baseDir: cwd,
|
|
110
113
|
commandName
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
console.log('🔀 Primary worktree detected. Auto-created linked worktree for task execution.');
|
|
117
|
+
console.log(`- base branch: ${baseBranch}`);
|
|
114
118
|
console.log(`- branch: ${branchName}`);
|
|
115
119
|
console.log(`- path: ${worktreePath}`);
|
|
116
120
|
console.log('');
|