git-watchtower 1.9.10 → 1.9.12
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 +7 -2
- package/package.json +1 -1
package/bin/git-watchtower.js
CHANGED
|
@@ -732,6 +732,7 @@ const { ansi, box, truncate, sparkline: uiSparkline, visibleLength, stripAnsi, p
|
|
|
732
732
|
|
|
733
733
|
// Error detection utilities imported from src/utils/errors.js
|
|
734
734
|
const { ErrorHandler, isAuthError, isMergeConflict, isNetworkError } = require('../src/utils/errors');
|
|
735
|
+
const { Mutex } = require('../src/utils/async');
|
|
735
736
|
|
|
736
737
|
// Keyboard handling utilities imported from src/ui/keybindings.js
|
|
737
738
|
const { filterBranches } = require('../src/ui/keybindings');
|
|
@@ -1402,7 +1403,6 @@ async function switchToBranch(branchName, recordHistory = true) {
|
|
|
1402
1403
|
const hasLocal = localBranches.split('\n').some(b => b.trim().replace(/^\* /, '') === safeBranchName);
|
|
1403
1404
|
|
|
1404
1405
|
if (hasLocal) {
|
|
1405
|
-
await execGitSilent(['checkout', '--', '.'], { cwd: PROJECT_ROOT });
|
|
1406
1406
|
await execGit(['checkout', safeBranchName], { cwd: PROJECT_ROOT });
|
|
1407
1407
|
} else {
|
|
1408
1408
|
await execGit(['checkout', '-b', safeBranchName, `${REMOTE_NAME}/${safeBranchName}`], { cwd: PROJECT_ROOT });
|
|
@@ -1606,8 +1606,12 @@ async function stashAndRetry() {
|
|
|
1606
1606
|
// Polling
|
|
1607
1607
|
// ============================================================================
|
|
1608
1608
|
|
|
1609
|
+
const pollMutex = new Mutex();
|
|
1610
|
+
|
|
1609
1611
|
async function pollGitChanges() {
|
|
1610
|
-
if (
|
|
1612
|
+
// Skip if a poll is already in progress (don't queue)
|
|
1613
|
+
if (pollMutex.isLocked()) return;
|
|
1614
|
+
await pollMutex.acquire();
|
|
1611
1615
|
store.setState({ isPolling: true, pollingStatus: 'fetching' });
|
|
1612
1616
|
|
|
1613
1617
|
// Casino mode: start slot reels spinning (no sound - too annoying)
|
|
@@ -1966,6 +1970,7 @@ async function pollGitChanges() {
|
|
|
1966
1970
|
}
|
|
1967
1971
|
} finally {
|
|
1968
1972
|
store.setState({ isPolling: false });
|
|
1973
|
+
pollMutex.release();
|
|
1969
1974
|
render();
|
|
1970
1975
|
}
|
|
1971
1976
|
}
|
package/package.json
CHANGED