fix: Address review comments

This commit is contained in:
gsxdsm
2026-02-18 19:52:25 -08:00
parent 4ba0026aa1
commit 4ee160fae4
16 changed files with 184 additions and 35 deletions

View File

@@ -144,11 +144,11 @@ async function fetchRemotes(cwd: string): Promise<void> {
* Parse a remote branch name like "origin/feature-branch" into its parts
*/
function parseRemoteBranch(branchName: string): { remote: string; branch: string } | null {
const slashIndex = branchName.indexOf('/');
if (slashIndex === -1) return null;
const lastSlash = branchName.lastIndexOf('/');
if (lastSlash === -1) return null;
return {
remote: branchName.substring(0, slashIndex),
branch: branchName.substring(slashIndex + 1),
remote: branchName.substring(0, lastSlash),
branch: branchName.substring(lastSlash + 1),
};
}