summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}