diff options
| author | Jeff Carr <[email protected]> | 2025-10-04 17:37:09 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-04 17:37:09 -0500 |
| commit | 6c645cb22ab96a8154053071360f4e45523733ce (patch) | |
| tree | 5d325af12977f6210b8a819b50815c3baec00cba | |
| parent | b88cc6bcb7e12ac919a0c76412ac0ff2e5b87dd2 (diff) | |
attempt to clean/delete user branchesv0.25.51
| -rw-r--r-- | doClean.go | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -171,8 +171,17 @@ func doRepoCleanUser(repo *gitpb.Repo) error { bruser := repo.GetUserBranchName() brdevel := repo.GetDevelBranchName() + brmaster := repo.GetMasterBranchName() if repo.IsBranchRemote(bruser) { + b1 := repo.CountDiffObjects(bruser, "refs/heads/"+brdevel) // should be zero + if b1 == 0 { + log.Info("Local user branch is safe to delete", bruser) + } + b2 := repo.CountDiffObjects("refs/heads/"+bruser, "refs/heads/"+brmaster) // should be zero + if b2 == 0 { + log.Info("Local remote branch is safe to delete (is completely in master)", bruser) + } log.Info("forge is designed to always have local only user branches", bruser) return fmt.Errorf("forge is designed to always have local only user branches") } @@ -197,8 +206,6 @@ func doRepoCleanUser(repo *gitpb.Repo) error { } } - brmaster := repo.GetMasterBranchName() - // will you loose work if you delete your user branch? // if master branch exists() // then if all user commits exist in master |
