git-watchtower 1.9.6 → 1.9.7
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 +10 -4
- package/package.json +1 -1
package/bin/git-watchtower.js
CHANGED
|
@@ -1691,11 +1691,17 @@ async function pollGitChanges() {
|
|
|
1691
1691
|
for (const knownName of knownBranchNames) {
|
|
1692
1692
|
if (!fetchedBranchNames.has(knownName)) {
|
|
1693
1693
|
// This branch was deleted from remote
|
|
1694
|
+
// Check if already present in allBranches (avoid duplicates)
|
|
1695
|
+
const alreadyInList = allBranches.some(b => b.name === knownName);
|
|
1696
|
+
if (alreadyInList) continue;
|
|
1697
|
+
|
|
1694
1698
|
const existingInList = currentBranches.find(b => b.name === knownName);
|
|
1695
|
-
if (existingInList
|
|
1696
|
-
existingInList.isDeleted
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
+
if (existingInList) {
|
|
1700
|
+
if (!existingInList.isDeleted) {
|
|
1701
|
+
existingInList.isDeleted = true;
|
|
1702
|
+
existingInList.deletedAt = now;
|
|
1703
|
+
addLog(`Branch deleted: ${knownName}`, 'warning');
|
|
1704
|
+
}
|
|
1699
1705
|
// Keep it in the list temporarily
|
|
1700
1706
|
allBranches.push(existingInList);
|
|
1701
1707
|
}
|
package/package.json
CHANGED