summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-26 03:10:00 -0500
committerJeff Carr <[email protected]>2025-09-26 03:10:00 -0500
commitc5d2f294c46ea64313aa27479155dd78739c567a (patch)
tree19da4e67904bf3c15e450e9cbb75a29fcffa7d55 /doClean.go
parent057577571c84c82c51c2209801b9e8e8c00824e0 (diff)
attempt to detect this correctlyv0.25.35
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/doClean.go b/doClean.go
index fba6ab0..8ad3042 100644
--- a/doClean.go
+++ b/doClean.go
@@ -272,6 +272,8 @@ func checkRemoteBranches(repo *gitpb.Repo) error {
}
func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
+ var safe bool = true
+ var baderr error
ids := make(map[string]string)
s1 := fmt.Sprintf("%s..%s", b1, b2)
s2 := fmt.Sprintf("%s..%s", b2, b1)
@@ -281,6 +283,8 @@ func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
for _, hash := range stats.Stdout {
patchId, err := repo.FindPatchId(hash)
if err != nil {
+ baderr = err
+ safe = false
continue
}
ids[patchId] = hash
@@ -293,11 +297,15 @@ func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
for _, hash := range stats.Stdout {
patchId, err := repo.FindPatchId(hash)
if err != nil {
+ baderr = err
+ safe = false
continue
}
if val, ok := ids[patchId]; ok {
log.Info(patchId, hash, "already here as", val)
} else {
+ log.Info(hash, "this probably means this branch is not safe to delete")
+ safe = false
ids[patchId] = hash
}
}
@@ -306,5 +314,8 @@ func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
log.Info(key, val)
}
- return nil
+ if !safe {
+ log.Info("branch is probably not safe to delete", b1, b2, baderr)
+ }
+ return baderr
}