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.
- package/bin/git-watchtower.js +8 -5
- package/package.json +1 -1
package/bin/git-watchtower.js
CHANGED
|
@@ -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
|
|
1749
|
+
// Remove stale entries from caches for branches
|
|
1751
1750
|
// that no longer exist in the current poll results
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
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