git-watchtower 1.8.4 → 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/bin/git-watchtower.js +5 -4
- package/package.json +1 -1
- package/src/git/branch.js +2 -2
package/bin/git-watchtower.js
CHANGED
|
@@ -622,10 +622,8 @@ function startServerProcess() {
|
|
|
622
622
|
addLog(`Starting: ${SERVER_COMMAND}`, 'update');
|
|
623
623
|
addServerLog(`$ ${SERVER_COMMAND}`);
|
|
624
624
|
|
|
625
|
-
// Parse command and args
|
|
626
|
-
const
|
|
627
|
-
const cmd = parts[0];
|
|
628
|
-
const args = parts.slice(1);
|
|
625
|
+
// Parse command and args (handles quoted arguments like `npm run "my script"`)
|
|
626
|
+
const { command: cmd, args } = parseCommand(SERVER_COMMAND);
|
|
629
627
|
|
|
630
628
|
// Use shell on Windows, direct spawn elsewhere
|
|
631
629
|
const isWindows = process.platform === 'win32';
|
|
@@ -741,6 +739,9 @@ const actions = require('../src/ui/actions');
|
|
|
741
739
|
// Diff stats parsing and stash imported from src/git/commands.js
|
|
742
740
|
const { parseDiffStats, stash: gitStash, stashPop: gitStashPop } = require('../src/git/commands');
|
|
743
741
|
|
|
742
|
+
// Server process command parsing
|
|
743
|
+
const { parseCommand } = require('../src/server/process');
|
|
744
|
+
|
|
744
745
|
// State (non-store globals)
|
|
745
746
|
let previousBranchStates = new Map(); // branch name -> commit hash
|
|
746
747
|
let knownBranchNames = new Set(); // Track known branches to detect NEW ones
|
package/package.json
CHANGED
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(
|
|
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 [];
|