git-watchtower 1.8.5 → 1.8.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
package/src/git/branch.js CHANGED
@@ -225,7 +225,7 @@ async function checkout(branchName, options = {}) {
225
225
  const { stdout: localBranches } = await execGit(['branch', '--list'], { cwd });
226
226
  const hasLocal = localBranches
227
227
  .split('\n')
228
- .some((b) => b.trim().replace('* ', '') === safeName);
228
+ .some((b) => b.trim().replace(/^\* /, '') === safeName);
229
229
 
230
230
  if (hasLocal) {
231
231
  // Local branch exists - just check out
@@ -335,7 +335,7 @@ async function getLocalBranches(cwd) {
335
335
  const { stdout } = await execGit(['branch', '--list'], { cwd });
336
336
  return stdout
337
337
  .split('\n')
338
- .map((b) => b.trim().replace('* ', ''))
338
+ .map((b) => b.trim().replace(/^\* /, ''))
339
339
  .filter(Boolean);
340
340
  } catch (error) {
341
341
  return [];