fix(branching): capture decimal phase numbers in commit regex

The phase-extraction regex /(\d+)-/ only matched the last integer
segment before a dash, so decimal phases like 45.14 were misresolved
to phase 14 — silently switching to the wrong branch.

Closes #1402

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tibsfox
2026-03-26 19:42:19 -07:00
parent b5cbd47373
commit c1fd72f81f
2 changed files with 36 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ function cmdCommit(cwd, message, files, raw, amend, noVerify) {
let branchName = null;
if (config.branching_strategy === 'phase') {
// Determine which phase we're committing for from the file paths
const phaseMatch = (files || []).join(' ').match(/(\d+)-/);
const phaseMatch = (files || []).join(' ').match(/(\d+(?:\.\d+)*)-/);
if (phaseMatch) {
const phaseNum = phaseMatch[1];
const phaseInfo = findPhaseInternal(cwd, phaseNum);