git-watchtower 1.9.11 → 1.9.13

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.
@@ -1403,7 +1403,6 @@ async function switchToBranch(branchName, recordHistory = true) {
1403
1403
  const hasLocal = localBranches.split('\n').some(b => b.trim().replace(/^\* /, '') === safeBranchName);
1404
1404
 
1405
1405
  if (hasLocal) {
1406
- await execGitSilent(['checkout', '--', '.'], { cwd: PROJECT_ROOT });
1407
1406
  await execGit(['checkout', safeBranchName], { cwd: PROJECT_ROOT });
1408
1407
  } else {
1409
1408
  await execGit(['checkout', '-b', safeBranchName, `${REMOTE_NAME}/${safeBranchName}`], { cwd: PROJECT_ROOT });
@@ -1747,11 +1746,15 @@ async function pollGitChanges() {
1747
1746
  previousBranchStates.set(branch.name, branch.commit);
1748
1747
  }
1749
1748
 
1750
- // Remove stale entries from previousBranchStates for branches
1749
+ // Remove stale entries from caches for branches
1751
1750
  // that no longer exist in the current poll results
1752
- for (const name of previousBranchStates.keys()) {
1753
- if (!activeBranchNames.has(name)) {
1754
- previousBranchStates.delete(name);
1751
+ const staleCaches = [previousBranchStates, prInfoCache, store.get('sparklineCache'), store.get('aheadBehindCache')];
1752
+ for (const cache of staleCaches) {
1753
+ if (!cache) continue;
1754
+ for (const name of cache.keys()) {
1755
+ if (!activeBranchNames.has(name)) {
1756
+ cache.delete(name);
1757
+ }
1755
1758
  }
1756
1759
  }
1757
1760
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.11",
3
+ "version": "1.9.13",
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": {